heim-rs / heim

Cross-platform async library for system information fetching 🦀
https://heim-rs.github.io/
Apache License 2.0
902 stars 95 forks source link

Added FAT file system so that FAT formatted disks are recognized #330

Open bvaisvil opened 3 years ago

bvaisvil commented 3 years ago

On MacOS, external disks that are formatted with FAT16/FAT32 (yes, I still have some!) are filtered (is_physical) from the list of file systems because the file system name is 'msdos', which isn't in the FileSystem enum.

Before the change:

Partition { device: Some("/dev/disk1s1"), mount_point: "/", file_system: Apfs }
Partition { device: Some("/dev/disk1s4"), mount_point: "/private/var/vm", file_system: Apfs }

After the change:

Partition { device: Some("/dev/disk1s1"), mount_point: "/", file_system: Apfs }
Partition { device: Some("/dev/disk1s4"), mount_point: "/private/var/vm", file_system: Apfs }
Partition { device: Some("/dev/disk2s1"), mount_point: "/Volumes/NO NAME", file_system: Fat }

Though the result from statfs is msdos I made the enum value Fat. Let me know if you'd like something different or to use the existing VFat

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.6%) to 45.551% when pulling 73b4a971a2d9c8c5ed02c6de7ab3d2cbdfc128c7 on bvaisvil:file_system_names into b292f1535bb27c03800cdb7509fa81a40859fbbb on heim-rs:master.