Implement ISO9660 statfs.

This commit is contained in:
2019-07-19 15:15:00 +01:00
parent 8a6a6c32ec
commit 386f826ae8
2 changed files with 26 additions and 7 deletions

View File

@@ -42,7 +42,12 @@ namespace DiscImageChef.Filesystems.ISO9660
// This is coded following ECMA-119. // This is coded following ECMA-119.
public partial class ISO9660 : IReadOnlyFilesystem public partial class ISO9660 : IReadOnlyFilesystem
{ {
bool debug;
IMediaImage image;
bool mounted;
Namespace @namespace; Namespace @namespace;
List<DecodedDirectoryEntry> rootDirectory;
FileSystemInfo statfs;
public FileSystemType XmlFsType { get; private set; } public FileSystemType XmlFsType { get; private set; }
public Encoding Encoding { get; private set; } public Encoding Encoding { get; private set; }

View File

@@ -13,11 +13,6 @@ namespace DiscImageChef.Filesystems.ISO9660
{ {
public partial class ISO9660 public partial class ISO9660
{ {
bool debug;
IMediaImage image;
bool mounted;
List<DecodedDirectoryEntry> rootDirectory;
public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding,
Dictionary<string, string> options, string @namespace) Dictionary<string, string> options, string @namespace)
{ {
@@ -326,6 +321,18 @@ namespace DiscImageChef.Filesystems.ISO9660
XmlFsType.Clusters = decodedVd.Blocks; XmlFsType.Clusters = decodedVd.Blocks;
XmlFsType.ClusterSize = decodedVd.BlockSize; XmlFsType.ClusterSize = decodedVd.BlockSize;
statfs = new FileSystemInfo
{
Blocks = decodedVd.Blocks,
FilenameLength = (ushort)(jolietvd != null
? this.@namespace == Namespace.Joliet
? 110
: 255
: 255),
PluginId = Id,
Type = fsFormat
};
image = imagePlugin; image = imagePlugin;
mounted = true; mounted = true;
return Errno.NoError; return Errno.NoError;
@@ -341,6 +348,13 @@ namespace DiscImageChef.Filesystems.ISO9660
return Errno.NoError; return Errno.NoError;
} }
public Errno StatFs(out FileSystemInfo stat) => throw new NotImplementedException(); public Errno StatFs(out FileSystemInfo stat)
{
stat = null;
if(!mounted) return Errno.AccessDenied;
stat = statfs.ShallowCopy();
return Errno.NoError;
}
} }
} }