示例#1
0
        private long DeleteDirectory(ServiceCtx context, bool recursive)
        {
            string name = ReadUtf8String(context);

            string dirName = _provider.GetFullPath(name);

            if (!Directory.Exists(dirName))
            {
                return(MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist));
            }

            if (IsPathAlreadyInUse(dirName))
            {
                return(MakeError(ErrorModule.Fs, FsErr.PathAlreadyInUse));
            }

            _provider.DeleteDirectory(dirName, recursive);

            return(0);
        }
示例#2
0
        private long DeleteDirectory(ServiceCtx Context, bool Recursive)
        {
            string Name = ReadUtf8String(Context);

            string DirName = Provider.GetFullPath(Name);

            if (!Directory.Exists(DirName))
            {
                return(MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist));
            }

            if (IsPathAlreadyInUse(DirName))
            {
                return(MakeError(ErrorModule.Fs, FsErr.PathAlreadyInUse));
            }

            Provider.DeleteDirectory(DirName, Recursive);

            return(0);
        }