Ejemplo n.º 1
0
        // CleanDirectoryRecursively(buffer<bytes<0x301>, 0x19, 0x301> path)
        public long CleanDirectoryRecursively(ServiceCtx context)
        {
            string name = ReadUtf8String(context);

            if (!_provider.DirectoryExists(name))
            {
                return(MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist));
            }

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

            try
            {
                _provider.CleanDirectoryRecursively(name);
            }
            catch (UnauthorizedAccessException)
            {
                Logger.PrintError(LogClass.ServiceFs, $"Unable to access {name}");

                throw;
            }

            return(0);
        }
Ejemplo n.º 2
0
        // CleanDirectoryRecursively(buffer<bytes<0x301>, 0x19, 0x301> path)
        public long CleanDirectoryRecursively(ServiceCtx context)
        {
            string name = ReadUtf8String(context);

            try
            {
                _fileSystem.CleanDirectoryRecursively(name);
            }
            catch (HorizonResultException ex)
            {
                return(ex.ResultValue.Value);
            }

            return(0);
        }
Ejemplo n.º 3
0
        // CleanDirectoryRecursively(buffer<bytes<0x301>, 0x19, 0x301> path)
        public ResultCode CleanDirectoryRecursively(ServiceCtx context)
        {
            string name = ReadUtf8String(context);

            return((ResultCode)_fileSystem.CleanDirectoryRecursively(name).Value);
        }