static internal int Create(
                string filename,
                FileAccess access,
                FileShare share,
                FileMode mode,
                FileOptions options,
                Node tree,
                FileCache fileCache,
                FileHandles fileHandles,
                PlasticAPI api,
                WorkspaceLocalFiles localFiles,
                Dynamic.HistoryDirectory historyDir,
                out bool bIsDirectory,
                out int error)
            {
                error        = 0;
                bIsDirectory = false;

                int handle = Dynamic.SpecNode.CreateFile(
                    filename, access, share, mode, options,
                    tree, fileCache, fileHandles, api);

                if (handle != -1)
                {
                    return(handle);
                }

                if (historyDir.CreateNewDir(
                        filename, access, tree, api))
                {
                    bIsDirectory = true;
                    return(-1);
                }

                return(LocalFile.CreateNew(
                           filename, access, share, mode, options, tree, localFiles, out error));
            }