// DeleteFile(buffer<bytes<0x301>, 0x19, 0x301> path) public long DeleteFile(ServiceCtx context) { string name = ReadUtf8String(context); if (!_provider.FileExists(name)) { return(MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist)); } if (IsPathAlreadyInUse(name)) { return(MakeError(ErrorModule.Fs, FsErr.PathAlreadyInUse)); } try { _provider.DeleteFile(name); } catch (FileNotFoundException) { return(MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist)); } catch (UnauthorizedAccessException) { Logger.PrintError(LogClass.ServiceFs, $"Unable to access {name}"); throw; } return(0); }
// DeleteFile(buffer<bytes<0x301>, 0x19, 0x301> path) public long DeleteFile(ServiceCtx context) { string name = ReadUtf8String(context); try { _fileSystem.DeleteFile(name); } catch (HorizonResultException ex) { return(ex.ResultValue.Value); } return(0); }
// DeleteFile(buffer<bytes<0x301>, 0x19, 0x301> path) public ResultCode DeleteFile(ServiceCtx context) { string name = ReadUtf8String(context); try { _fileSystem.DeleteFile(name); } catch (HorizonResultException ex) { return((ResultCode)ex.ResultValue.Value); } return(ResultCode.Success); }
// DeleteFile(buffer<bytes<0x301>, 0x19, 0x301> path) public ResultCode DeleteFile(ServiceCtx context) { string name = ReadUtf8String(context); return((ResultCode)_fileSystem.DeleteFile(name).Value); }