// GetEntryType(buffer<bytes<0x301>, 0x19, 0x301> path) -> nn::fssrv::sf::DirectoryEntryType public long GetEntryType(ServiceCtx context) { string name = ReadUtf8String(context); try { LibHac.Fs.DirectoryEntryType entryType = _provider.GetEntryType(name); context.ResponseData.Write((int)entryType); } catch (FileNotFoundException) { context.ResponseData.Write(0); return(MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist)); } return(0); }
// GetEntryType(buffer<bytes<0x301>, 0x19, 0x301> path) -> nn::fssrv::sf::DirectoryEntryType public long GetEntryType(ServiceCtx context) { string name = ReadUtf8String(context); try { DirectoryEntryType entryType = _fileSystem.GetEntryType(name); if (entryType == DirectoryEntryType.Directory || entryType == DirectoryEntryType.File) { context.ResponseData.Write((int)entryType); } else { return(MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist)); } } catch (HorizonResultException ex) { return(ex.ResultValue.Value); } return(0); }
// GetEntryType(buffer<bytes<0x301>, 0x19, 0x301> path) -> nn::fssrv::sf::DirectoryEntryType public ResultCode GetEntryType(ServiceCtx context) { string name = ReadUtf8String(context); try { DirectoryEntryType entryType = _fileSystem.GetEntryType(name); if (entryType == DirectoryEntryType.Directory || entryType == DirectoryEntryType.File) { context.ResponseData.Write((int)entryType); } else { return(ResultCode.PathDoesNotExist); } } catch (HorizonResultException ex) { return((ResultCode)ex.ResultValue.Value); } return(ResultCode.Success); }