-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Description
When using DriveInfo to check the DriveType of an exfat filesystem, it returns unknown. Also the filesystem shows as blank.
Reproduction Steps
Create a file based filesystem for a quick test (likely need to sudo to mount the test.img)
dd if=/dev/zero of=test.img bs=1M count=1024
mkfs.exfat test.img
mount -o loop test.img /mnt/testing
DriveInfo d = new DriveInfo("/mnt/test");
Console.WriteLine("Drive {0}", d.Name);
Console.WriteLine(" Drive type: {0}", d.DriveType);
Console.WriteLine(" File system: {0}", d.DriveFormat);
Expected behavior
I think, something like this. Similar to exfat
Drive /mnt/test
Drive type: Fixed
File system: msdos
Actual behavior
Drive /mnt/test
Drive type: Unknown
File system:
Regression?
No, seems to have been this way since exfat was added as a filesystem type
Known Workarounds
None
Configuration
.Net 9.0.105
Linux - Arch
x86_64
Might be specific to Linux, unable to try on Windows or Mac
Other information
The problem appears to be because of a missing entry in the UnixFileSystemTypes enum
The FormatInfo uses this to look up the format/type, defaulting to Unknown / string.Empty when the entry is missing.
The comments in UnixFileSystemTypes say it should kept inline with the statfs man page, only the stat coreutils added the exfat with it's corresponding magic number without updating the man page.
https://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.32-109-ga5e0d8f387