public IDirectory OpenDirectory(string path, OpenDirectoryMode mode)
        {
            string fullPath = GetFullPath(PathTools.Normalize(path));

            lock (Locker)
            {
                return(BaseFs.OpenDirectory(fullPath, mode));
            }
        }
示例#2
0
        protected override Result OpenDirectoryImpl(out IDirectory directory, string path, OpenDirectoryMode mode)
        {
            string fullPath = GetFullPath(PathTools.Normalize(path));

            lock (Locker)
            {
                return(BaseFs.OpenDirectory(out directory, fullPath, mode));
            }
        }
        private void SynchronizeDirectory(string dest, string src)
        {
            if (BaseFs.DirectoryExists(dest))
            {
                BaseFs.DeleteDirectoryRecursively(dest);
            }

            BaseFs.CreateDirectory(dest);

            IDirectory sourceDir = BaseFs.OpenDirectory(src, OpenDirectoryMode.All);
            IDirectory destDir   = BaseFs.OpenDirectory(dest, OpenDirectoryMode.All);

            sourceDir.CopyDirectory(destDir);
        }
        protected override Result DoOpenDirectory(out IDirectory directory, U8Span path, OpenDirectoryMode mode)
        {
            Unsafe.SkipInit(out FsPath fullPath);

            Result rc = ResolveFullPath(fullPath.Str, path);

            if (rc.IsFailure())
            {
                UnsafeHelpers.SkipParamInit(out directory);
                return(rc);
            }

            lock (Locker)
            {
                return(BaseFs.OpenDirectory(out directory, fullPath, mode));
            }
        }
        protected override Result DoOpenDirectory(out IDirectory directory, U8Span path, OpenDirectoryMode mode)
        {
            FsPath fullPath;

            unsafe { _ = &fullPath; } // workaround for CS0165

            Result rc = ResolveFullPath(fullPath.Str, path);

            if (rc.IsFailure())
            {
                directory = default;
                return(rc);
            }

            lock (Locker)
            {
                return(BaseFs.OpenDirectory(out directory, fullPath, mode));
            }
        }
示例#6
0
 protected override Result DoOpenDirectory(out IDirectory directory, U8Span path, OpenDirectoryMode mode)
 {
     return(BaseFs.OpenDirectory(out directory, path, mode));
 }