简体   繁体   中英

C++ know if disk/usb is FAT32 formatted with low level io code

Is it possible to know if an USB has the FAT32 filesystem using low level IO on OSX, I've seen examples and stuff using win32 API, but I'm looking for some more low-level. Right now my FAT32 detection uses the terminal command 'diskutil' info /dev/mydisk is it possible to open the disk and read if it is FAT32 or any other filesystem?

Not low level, but you can use getmntinfo .

Iterate through statfs structs returned, matching the path where USB is mounted with statfs.f_mntonname or /dev/mydisk with statfs.f_mntfromname.

statfs.f_fstypename is the filesystem name, msdos for FAT.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM