diff --git a/DiscImageChef.CommonTypes/Structs/Filesystems.cs b/DiscImageChef.CommonTypes/Structs/Filesystems.cs
index 19eeb54b5..e7e6e176a 100644
--- a/DiscImageChef.CommonTypes/Structs/Filesystems.cs
+++ b/DiscImageChef.CommonTypes/Structs/Filesystems.cs
@@ -161,62 +161,60 @@ namespace DiscImageChef.CommonTypes.Structs
public long Blocks;
/// File block size in bytes
public long BlockSize;
- /// If file points to a device, device number
- public ulong DeviceNo;
- /// POSIX group ID
- public ulong GID;
-
- /// inode number for this file
+ /// If file points to a device, device number. Null if the underlying filesystem does not support them.
+ public ulong? DeviceNo;
+ /// POSIX group ID. Null if the underlying filesystem does not support them.
+ public ulong? GID;
+ /// inode number for this file (or other unique identifier for the volume)
public ulong Inode;
/// File length in bytes
public long Length;
- /// Number of hard links pointing to this file
+ /// Number of hard links pointing to this file (. and .. entries count as hard links)
public ulong Links;
- /// POSIX permissions/mode for this file
- public uint Mode;
- /// POSIX owner ID
- public ulong UID;
+ /// POSIX permissions/mode for this file. Null if the underlying filesystem does not support them.
+ public uint? Mode;
+ /// POSIX owner ID. Null if the underlying filesystem does not support them.
+ public ulong? UID;
+ /// File creation date in UTC. Null if the underlying filesystem does not support them.
+ public DateTime? CreationTimeUtc { get; set; }
+ /// File last access date in UTC. Null if the underlying filesystem does not support them.
+ public DateTime? AccessTimeUtc { get; set; }
+ /// File attributes change date in UTC. Null if the underlying filesystem does not support them.
+ public DateTime? StatusChangeTimeUtc { get; set; }
+ /// File last backup date in UTC. Null if the underlying filesystem does not support them.
+ public DateTime? BackupTimeUtc { get; set; }
+ /// File last modification date in UTC. Null if the underlying filesystem does not support them.
+ public DateTime? LastWriteTimeUtc { get; set; }
- /// File creation date in UTC
- public DateTime CreationTimeUtc { get; set; }
- /// File last access date in UTC
- public DateTime AccessTimeUtc { get; set; }
- /// File attributes change date in UTC
- public DateTime StatusChangeTimeUtc { get; set; }
- /// File last backup date in UTC
- public DateTime BackupTimeUtc { get; set; }
- /// File last modification date in UTC
- public DateTime LastWriteTimeUtc { get; set; }
-
- /// File creation date
- public DateTime CreationTime
+ /// File creation date. Null if the underlying filesystem does not support them.
+ public DateTime? CreationTime
{
- get => CreationTimeUtc.ToLocalTime();
- set => CreationTimeUtc = value.ToUniversalTime();
+ get => CreationTimeUtc?.ToLocalTime();
+ set => CreationTimeUtc = value?.ToUniversalTime();
}
- /// File last access date
- public DateTime AccessTime
+ /// File last access date. Null if the underlying filesystem does not support them.
+ public DateTime? AccessTime
{
- get => AccessTimeUtc.ToLocalTime();
- set => AccessTimeUtc = value.ToUniversalTime();
+ get => AccessTimeUtc?.ToLocalTime();
+ set => AccessTimeUtc = value?.ToUniversalTime();
}
- /// File attributes change date
- public DateTime StatusChangeTime
+ /// File attributes change date. Null if the underlying filesystem does not support them.
+ public DateTime? StatusChangeTime
{
- get => StatusChangeTimeUtc.ToLocalTime();
- set => StatusChangeTimeUtc = value.ToUniversalTime();
+ get => StatusChangeTimeUtc?.ToLocalTime();
+ set => StatusChangeTimeUtc = value?.ToUniversalTime();
}
- /// File last backup date
- public DateTime BackupTime
+ /// File last backup date. Null if the underlying filesystem does not support them.
+ public DateTime? BackupTime
{
- get => BackupTimeUtc.ToLocalTime();
- set => BackupTimeUtc = value.ToUniversalTime();
+ get => BackupTimeUtc?.ToLocalTime();
+ set => BackupTimeUtc = value?.ToUniversalTime();
}
- /// File last modification date
- public DateTime LastWriteTime
+ /// File last modification date. Null if the underlying filesystem does not support them.
+ public DateTime? LastWriteTime
{
- get => LastWriteTimeUtc.ToLocalTime();
- set => LastWriteTimeUtc = value.ToUniversalTime();
+ get => LastWriteTimeUtc?.ToLocalTime();
+ set => LastWriteTimeUtc = value?.ToUniversalTime();
}
}
@@ -236,7 +234,6 @@ namespace DiscImageChef.CommonTypes.Structs
public FileSystemId Id;
/// ID of plugin for this file
public Guid PluginId;
-
/// Filesystem type
public string Type;
diff --git a/DiscImageChef.Filesystems/AppleMFS/File.cs b/DiscImageChef.Filesystems/AppleMFS/File.cs
index 574076a3b..a4a90170b 100644
--- a/DiscImageChef.Filesystems/AppleMFS/File.cs
+++ b/DiscImageChef.Filesystems/AppleMFS/File.cs
@@ -169,14 +169,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
{
stat = new FileEntryInfo
{
- BlockSize = device.Info.SectorSize,
- DeviceNo = 0,
- GID = 0,
- Inode = 0,
- Links = 1,
- Mode = 0x124,
- UID = 0,
- Attributes = FileAttributes.System
+ BlockSize = device.Info.SectorSize, Inode = 0, Links = 1, Attributes = FileAttributes.System
};
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0)
@@ -217,14 +210,10 @@ namespace DiscImageChef.Filesystems.AppleMFS
Blocks = entry.flLgLen / volMDB.drAlBlkSiz,
BlockSize = volMDB.drAlBlkSiz,
CreationTime = DateHandlers.MacToDateTime(entry.flCrDat),
- DeviceNo = 0,
- GID = 0,
Inode = entry.flFlNum,
LastWriteTime = DateHandlers.MacToDateTime(entry.flMdDat),
Length = entry.flPyLen,
- Links = 1,
- Mode = 0x124,
- UID = 0
+ Links = 1
};
return Errno.NoError;
@@ -304,8 +293,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
else
{
if(resourceFork)
- if(ms.Length < entry.flRLgLen)
- buf = ms.ToArray();
+ if(ms.Length < entry.flRLgLen) buf = ms.ToArray();
else
{
buf = new byte[entry.flRLgLen];
diff --git a/DiscImageChef.Filesystems/FATX/File.cs b/DiscImageChef.Filesystems/FATX/File.cs
index a3c473647..e52c7f99f 100644
--- a/DiscImageChef.Filesystems/FATX/File.cs
+++ b/DiscImageChef.Filesystems/FATX/File.cs
@@ -128,13 +128,9 @@ namespace DiscImageChef.Filesystems.FATX
Attributes = FileAttributes.Directory | FileAttributes.System | FileAttributes.Hidden,
Blocks = GetClusters(superblock.rootDirectoryCluster).Length,
BlockSize = bytesPerCluster,
- DeviceNo = 0,
- GID = 0,
Length = GetClusters(superblock.rootDirectoryCluster).Length * bytesPerCluster,
Inode = superblock.rootDirectoryCluster,
- Links = 1,
- Mode = 0x16D,
- UID = 0
+ Links = 1
};
return Errno.NoError;
@@ -148,13 +144,9 @@ namespace DiscImageChef.Filesystems.FATX
Attributes = new FileAttributes(),
Blocks = entry.length / bytesPerCluster,
BlockSize = bytesPerCluster,
- DeviceNo = 0,
- GID = 0,
Length = entry.length,
Inode = entry.firstCluster,
Links = 1,
- Mode = (uint)(entry.attributes.HasFlag(Attributes.Directory) ? 0x16D : 0x124),
- UID = 0,
CreationTime =
littleEndian
? DateHandlers.DosToDateTime(entry.creationDate, entry.creationTime).AddYears(20)
diff --git a/DiscImageChef.Filesystems/LisaFS/File.cs b/DiscImageChef.Filesystems/LisaFS/File.cs
index 97ae8f350..cbf953a3f 100644
--- a/DiscImageChef.Filesystems/LisaFS/File.cs
+++ b/DiscImageChef.Filesystems/LisaFS/File.cs
@@ -226,8 +226,7 @@ namespace DiscImageChef.Filesystems.LisaFS
ExtentFile file;
if(fileId <= 4)
- if(!debug || fileId == 0)
- return Errno.NoSuchFile;
+ if(!debug || fileId == 0) return Errno.NoSuchFile;
else
{
stat = new FileEntryInfo {Attributes = new FileAttributes()};
@@ -246,11 +245,7 @@ namespace DiscImageChef.Filesystems.LisaFS
stat.LastWriteTime = DateHandlers.LisaToDateTime(file.dtm);
stat.Inode = (ulong)fileId;
- stat.Mode = 0x124;
stat.Links = 0;
- stat.UID = 0;
- stat.GID = 0;
- stat.DeviceNo = 0;
stat.Length = mddf.datasize;
stat.BlockSize = mddf.datasize;
stat.Blocks = 1;
@@ -265,11 +260,7 @@ namespace DiscImageChef.Filesystems.LisaFS
stat.BackupTime = mddf.dtvb;
stat.Inode = (ulong)fileId;
- stat.Mode = 0x124;
stat.Links = 0;
- stat.UID = 0;
- stat.GID = 0;
- stat.DeviceNo = 0;
stat.Length = buf.Length;
stat.BlockSize = mddf.datasize;
stat.Blocks = buf.Length / mddf.datasize;
@@ -290,12 +281,8 @@ namespace DiscImageChef.Filesystems.LisaFS
stat.BackupTime = DateHandlers.LisaToDateTime(file.dtb);
stat.LastWriteTime = DateHandlers.LisaToDateTime(file.dtm);
- stat.Inode = (ulong)fileId;
- stat.Mode = 0x1B6;
- stat.Links = 1;
- stat.UID = 0;
- stat.GID = 0;
- stat.DeviceNo = 0;
+ stat.Inode = (ulong)fileId;
+ stat.Links = 1;
if(!fileSizeCache.TryGetValue(fileId, out int len)) stat.Length = srecords[fileId].filesize;
else stat.Length = len;
stat.BlockSize = mddf.datasize;
diff --git a/DiscImageChef.Filesystems/UCSDPascal/File.cs b/DiscImageChef.Filesystems/UCSDPascal/File.cs
index 7d9ba291e..e12ae9621 100644
--- a/DiscImageChef.Filesystems/UCSDPascal/File.cs
+++ b/DiscImageChef.Filesystems/UCSDPascal/File.cs
@@ -113,12 +113,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
{
Attributes = FileAttributes.System,
BlockSize = device.Info.SectorSize * multiplier,
- DeviceNo = 0,
- GID = 0,
- Inode = 0,
- Links = 1,
- Mode = 0x124,
- UID = 0
+ Links = 1
};
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0)
@@ -144,15 +139,10 @@ namespace DiscImageChef.Filesystems.UCSDPascal
Attributes = FileAttributes.File,
Blocks = entry.LastBlock - entry.FirstBlock,
BlockSize = device.Info.SectorSize * multiplier,
- DeviceNo = 0,
- GID = 0,
- Inode = 0,
LastWriteTimeUtc = DateHandlers.UcsdPascalToDateTime(entry.ModificationTime),
Length = (entry.LastBlock - entry.FirstBlock) * device.Info.SectorSize * multiplier +
entry.LastBytes,
- Links = 1,
- Mode = 0x124,
- UID = 0
+ Links = 1
};
return Errno.NoError;
diff --git a/DiscImageChef.Gui/Panels/pnlListFiles.xeto.cs b/DiscImageChef.Gui/Panels/pnlListFiles.xeto.cs
index a75c222a3..35038e46c 100644
--- a/DiscImageChef.Gui/Panels/pnlListFiles.xeto.cs
+++ b/DiscImageChef.Gui/Panels/pnlListFiles.xeto.cs
@@ -49,15 +49,15 @@ namespace DiscImageChef.Gui.Panels
// TODO: Show xattrs
public class pnlListFiles : Panel
{
- GridColumn accessColumn;
- bool ascendingSort;
- GridColumn attributesColumn;
- GridColumn backupColumn;
- GridColumn changedColumn;
- GridColumn createdColumn;
- ObservableCollection entries;
- IReadOnlyFilesystem filesystem;
- GridColumn gidColumn;
+ readonly GridColumn accessColumn;
+ bool ascendingSort;
+ readonly GridColumn attributesColumn;
+ readonly GridColumn backupColumn;
+ readonly GridColumn changedColumn;
+ readonly GridColumn createdColumn;
+ readonly ObservableCollection entries;
+ readonly IReadOnlyFilesystem filesystem;
+ readonly GridColumn gidColumn;
#region XAML controls
#pragma warning disable 169
@@ -67,15 +67,15 @@ namespace DiscImageChef.Gui.Panels
#pragma warning restore 649
#endregion
- GridColumn inodeColumn;
- GridColumn linksColumn;
- GridColumn modeColumn;
- GridColumn nameColumn;
- ButtonMenuItem saveFilesMenuItem;
- GridColumn sizeColumn;
- GridColumn sortedColumn;
- GridColumn uidColumn;
- GridColumn writeColumn;
+ readonly GridColumn inodeColumn;
+ readonly GridColumn linksColumn;
+ readonly GridColumn modeColumn;
+ readonly GridColumn nameColumn;
+ readonly ButtonMenuItem saveFilesMenuItem;
+ readonly GridColumn sizeColumn;
+ GridColumn sortedColumn;
+ readonly GridColumn uidColumn;
+ readonly GridColumn writeColumn;
public pnlListFiles(IReadOnlyFilesystem filesystem, Dictionary files, string parentPath)
{
@@ -406,19 +406,28 @@ namespace DiscImageChef.Gui.Panels
fs.Close();
FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
- try { fi.CreationTimeUtc = file.Stat.CreationTimeUtc; }
+ try
+ {
+ if(file.Stat.CreationTimeUtc.HasValue) fi.CreationTimeUtc = file.Stat.CreationTimeUtc.Value;
+ }
catch
{
// ignored
}
- try { fi.LastWriteTimeUtc = file.Stat.LastWriteTimeUtc; }
+ try
+ {
+ if(file.Stat.LastWriteTimeUtc.HasValue) fi.LastWriteTimeUtc = file.Stat.LastWriteTimeUtc.Value;
+ }
catch
{
// ignored
}
- try { fi.LastAccessTimeUtc = file.Stat.AccessTimeUtc; }
+ try
+ {
+ if(file.Stat.AccessTimeUtc.HasValue) fi.LastAccessTimeUtc = file.Stat.AccessTimeUtc.Value;
+ }
catch
{
// ignored
diff --git a/DiscImageChef/Commands/ExtractFiles.cs b/DiscImageChef/Commands/ExtractFiles.cs
index 734111089..36b2c3345 100644
--- a/DiscImageChef/Commands/ExtractFiles.cs
+++ b/DiscImageChef/Commands/ExtractFiles.cs
@@ -369,19 +369,28 @@ namespace DiscImageChef.Commands
DirectoryInfo di = new DirectoryInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
- try { di.CreationTimeUtc = stat.CreationTimeUtc; }
+ try
+ {
+ if(stat.CreationTimeUtc.HasValue) di.CreationTimeUtc = stat.CreationTimeUtc.Value;
+ }
catch
{
// ignored
}
- try { di.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
+ try
+ {
+ if(stat.LastWriteTimeUtc.HasValue) di.LastWriteTimeUtc = stat.LastWriteTimeUtc.Value;
+ }
catch
{
// ignored
}
- try { di.LastAccessTimeUtc = stat.AccessTimeUtc; }
+ try
+ {
+ if(stat.AccessTimeUtc.HasValue) di.LastAccessTimeUtc = stat.AccessTimeUtc.Value;
+ }
catch
{
// ignored
@@ -416,19 +425,30 @@ namespace DiscImageChef.Commands
outputFile.Close();
FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
- try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
+ try
+ {
+ if(stat.CreationTimeUtc.HasValue)
+ fi.CreationTimeUtc = stat.CreationTimeUtc.Value;
+ }
catch
{
// ignored
}
- try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
+ try
+ {
+ if(stat.LastWriteTimeUtc.HasValue)
+ fi.LastWriteTimeUtc = stat.LastWriteTimeUtc.Value;
+ }
catch
{
// ignored
}
- try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
+ try
+ {
+ if(stat.AccessTimeUtc.HasValue) fi.LastAccessTimeUtc = stat.AccessTimeUtc.Value;
+ }
catch
{
// ignored
@@ -461,19 +481,28 @@ namespace DiscImageChef.Commands
outputFile.Close();
FileInfo fi = new FileInfo(outputPath);
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
- try { fi.CreationTimeUtc = stat.CreationTimeUtc; }
+ try
+ {
+ if(stat.CreationTimeUtc.HasValue) fi.CreationTimeUtc = stat.CreationTimeUtc.Value;
+ }
catch
{
// ignored
}
- try { fi.LastWriteTimeUtc = stat.LastWriteTimeUtc; }
+ try
+ {
+ if(stat.LastWriteTimeUtc.HasValue) fi.LastWriteTimeUtc = stat.LastWriteTimeUtc.Value;
+ }
catch
{
// ignored
}
- try { fi.LastAccessTimeUtc = stat.AccessTimeUtc; }
+ try
+ {
+ if(stat.AccessTimeUtc.HasValue) fi.LastAccessTimeUtc = stat.AccessTimeUtc.Value;
+ }
catch
{
// ignored