protected override Result DoRenameFile(U8Span oldPath, U8Span newPath)
        {
            FsPath fullCurrentPath;
            FsPath fullNewPath;

            unsafe { _ = &fullCurrentPath; } // workaround for CS0165
            unsafe { _ = &fullNewPath; }     // workaround for CS0165

            Result rc = ResolveFullPath(fullCurrentPath.Str, oldPath);

            if (rc.IsFailure())
            {
                return(rc);
            }

            rc = ResolveFullPath(fullNewPath.Str, newPath);
            if (rc.IsFailure())
            {
                return(rc);
            }

            lock (Locker)
            {
                return(BaseFs.RenameFile(fullCurrentPath, fullNewPath));
            }
        }
Exemplo n.º 2
0
        public void RenameFile(string srcPath, string dstPath)
        {
            string fullSrcPath = GetFullPath(PathTools.Normalize(srcPath));
            string fullDstPath = GetFullPath(PathTools.Normalize(dstPath));

            lock (Locker)
            {
                BaseFs.RenameFile(fullSrcPath, fullDstPath);
            }
        }
Exemplo n.º 3
0
        protected override Result RenameFileImpl(string oldPath, string newPath)
        {
            string fullOldPath = GetFullPath(PathTools.Normalize(oldPath));
            string fullNewPath = GetFullPath(PathTools.Normalize(newPath));

            lock (Locker)
            {
                return(BaseFs.RenameFile(fullOldPath, fullNewPath));
            }
        }
        protected override Result DoRenameFile(U8Span oldPath, U8Span newPath)
        {
            Unsafe.SkipInit(out FsPath fullCurrentPath);
            Unsafe.SkipInit(out FsPath fullNewPath);

            Result rc = ResolveFullPath(fullCurrentPath.Str, oldPath);

            if (rc.IsFailure())
            {
                return(rc);
            }

            rc = ResolveFullPath(fullNewPath.Str, newPath);
            if (rc.IsFailure())
            {
                return(rc);
            }

            lock (Locker)
            {
                return(BaseFs.RenameFile(fullCurrentPath, fullNewPath));
            }
        }