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.AppleDOS
|
||||
/// </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;
|
||||
return !mounted ? Errno.AccessDenied : Errno.NotSupported;
|
||||
}
|
||||
|
||||
@@ -55,8 +56,9 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
/// </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;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
if(!string.IsNullOrEmpty(path) && string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
|
||||
|
||||
@@ -40,8 +40,9 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
{
|
||||
public partial class AppleDOS
|
||||
{
|
||||
public Errno GetAttributes(string path, ref FileAttributes attributes)
|
||||
public Errno GetAttributes(string path, out FileAttributes attributes)
|
||||
{
|
||||
attributes = new FileAttributes();
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
@@ -51,7 +52,6 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
|
||||
if(!fileCache.ContainsKey(filename)) return Errno.NoSuchFile;
|
||||
|
||||
attributes = new FileAttributes();
|
||||
attributes = FileAttributes.Extents;
|
||||
attributes |= FileAttributes.File;
|
||||
if(lockedFiles.Contains(filename)) attributes |= FileAttributes.ReadOnly;
|
||||
@@ -103,8 +103,9 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
public Errno Stat(string path, ref FileEntryInfo stat)
|
||||
public Errno Stat(string path, out FileEntryInfo stat)
|
||||
{
|
||||
stat = null;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
@@ -115,12 +116,10 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
|
||||
if(!fileCache.ContainsKey(filename)) return Errno.NoSuchFile;
|
||||
|
||||
FileAttributes attrs = new FileAttributes();
|
||||
stat = new FileEntryInfo();
|
||||
|
||||
fileSizeCache.TryGetValue(filename, out int filesize);
|
||||
GetAttributes(path, ref attrs);
|
||||
|
||||
stat = new FileEntryInfo();
|
||||
GetAttributes(path, out FileAttributes attrs);
|
||||
|
||||
if(debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
|
||||
string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
|
||||
@@ -148,8 +147,9 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
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 !mounted ? Errno.AccessDenied : Errno.NotImplemented;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
/// 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 = new FileSystemInfo
|
||||
{
|
||||
|
||||
@@ -43,8 +43,9 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
/// <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;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
Reference in New Issue
Block a user