mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
🎨Changed IReadOnlyFilesystem so methods that only output don't get passed as ref.
This commit is contained in:
@@ -45,8 +45,9 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// </summary>
|
||||
/// <param name="path">Link path.</param>
|
||||
/// <param name="dest">Link destination.</param>
|
||||
public Errno ReadLink(string path, ref string dest)
|
||||
public Errno ReadLink(string path, out string dest)
|
||||
{
|
||||
dest = null;
|
||||
// LisaFS does not support symbolic links (afaik)
|
||||
return Errno.NotSupported;
|
||||
}
|
||||
@@ -56,8 +57,9 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// </summary>
|
||||
/// <param name="path">Directory path.</param>
|
||||
/// <param name="contents">Directory contents.</param>
|
||||
public Errno ReadDir(string path, ref List<string> contents)
|
||||
public Errno ReadDir(string path, out List<string> contents)
|
||||
{
|
||||
contents = null;
|
||||
Errno error = LookupFileId(path, out short fileId, out bool isDir);
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
@@ -68,7 +70,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
if(error != Errno.NoError)
|
||||
return error;*/
|
||||
|
||||
ReadDir(fileId, ref contents);
|
||||
ReadDir(fileId, out contents);
|
||||
|
||||
// On debug add system files as readable files
|
||||
// Syntax similar to NTFS
|
||||
@@ -86,7 +88,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
Errno ReadDir(short dirId, ref List<string> contents)
|
||||
Errno ReadDir(short dirId, out List<string> contents)
|
||||
{
|
||||
// Do same trick as Mac OS X, replace filesystem '/' with '-',
|
||||
// as '-' is the path separator in Lisa OS
|
||||
|
||||
@@ -39,8 +39,9 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
public partial class LisaFS
|
||||
{
|
||||
public Errno MapBlock(string path, long fileBlock, ref long deviceBlock)
|
||||
public Errno MapBlock(string path, long fileBlock, out long deviceBlock)
|
||||
{
|
||||
deviceBlock = 0;
|
||||
// TODO: Not really important.
|
||||
return Errno.NotImplemented;
|
||||
}
|
||||
|
||||
@@ -39,14 +39,15 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
public partial class LisaFS
|
||||
{
|
||||
public Errno GetAttributes(string path, ref FileAttributes attributes)
|
||||
public Errno GetAttributes(string path, out FileAttributes attributes)
|
||||
{
|
||||
attributes = new FileAttributes();
|
||||
|
||||
Errno error = LookupFileId(path, out short fileId, out bool isDir);
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
if(!isDir) return GetAttributes(fileId, ref attributes);
|
||||
if(!isDir) return GetAttributes(fileId, out attributes);
|
||||
|
||||
attributes = new FileAttributes();
|
||||
attributes = FileAttributes.Directory;
|
||||
|
||||
return Errno.NoError;
|
||||
@@ -94,16 +95,18 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
public Errno Stat(string path, ref FileEntryInfo stat)
|
||||
public Errno Stat(string path, out FileEntryInfo stat)
|
||||
{
|
||||
stat = null;
|
||||
Errno error = LookupFileId(path, out short fileId, out bool isDir);
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
return isDir ? StatDir(fileId, out stat) : Stat(fileId, out stat);
|
||||
}
|
||||
|
||||
Errno GetAttributes(short fileId, ref FileAttributes attributes)
|
||||
Errno GetAttributes(short fileId, out FileAttributes attributes)
|
||||
{
|
||||
attributes = new FileAttributes();
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
if(fileId < 4)
|
||||
@@ -123,8 +126,6 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
attributes = new FileAttributes();
|
||||
|
||||
switch(extFile.ftype)
|
||||
{
|
||||
case FileType.Spool:
|
||||
@@ -231,7 +232,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
stat = new FileEntryInfo {Attributes = new FileAttributes()};
|
||||
|
||||
error = GetAttributes(fileId, ref stat.Attributes);
|
||||
error = GetAttributes(fileId, out stat.Attributes);
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
if(fileId < 0 && fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED)
|
||||
@@ -278,7 +279,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
}
|
||||
|
||||
stat = new FileEntryInfo {Attributes = new FileAttributes()};
|
||||
error = GetAttributes(fileId, ref stat.Attributes);
|
||||
error = GetAttributes(fileId, out stat.Attributes);
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
error = ReadExtentsFile(fileId, out file);
|
||||
|
||||
@@ -340,8 +340,9 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// Gets information about the mounted volume.
|
||||
/// </summary>
|
||||
/// <param name="stat">Information about the mounted volume.</param>
|
||||
public Errno StatFs(ref FileSystemInfo stat)
|
||||
public Errno StatFs(out FileSystemInfo stat)
|
||||
{
|
||||
stat = null;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
stat = new FileSystemInfo
|
||||
|
||||
@@ -46,12 +46,13 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <returns>Error number.</returns>
|
||||
/// <param name="path">Path.</param>
|
||||
/// <param name="xattrs">List of extended attributes, alternate data streams and forks.</param>
|
||||
public Errno ListXAttr(string path, ref List<string> xattrs)
|
||||
public Errno ListXAttr(string path, out List<string> xattrs)
|
||||
{
|
||||
xattrs = null;
|
||||
Errno error = LookupFileId(path, out short fileId, out bool isDir);
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
return isDir ? Errno.InvalidArgument : ListXAttr(fileId, ref xattrs);
|
||||
return isDir ? Errno.InvalidArgument : ListXAttr(fileId, out xattrs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -75,7 +76,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <returns>Error number.</returns>
|
||||
/// <param name="fileId">File identifier.</param>
|
||||
/// <param name="xattrs">Extended attributes.</param>
|
||||
Errno ListXAttr(short fileId, ref List<string> xattrs)
|
||||
Errno ListXAttr(short fileId, out List<string> xattrs)
|
||||
{
|
||||
xattrs = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user