Re: Determine if a file system supports files > 4GB
Le 12 août 2013 à 16:32, Jean-Daniel Dupas <devlists@shadowlab.org> a écrit :
Le 12 août 2013 à 15:34, Dragan Milić <milke@mac.com> a écrit :
I'm trying to determine if a file system supports "big" files (> 4GB). For that I used to use File Manager API and FSGetVolumeParms() to get extended volume attributes and then check for bSupports2TBFiles. Since the File Manager API has been deprecated as of OS X 10.8, I want to replace all usage of it by other APIs, but I couldn't figure out how to get this particular information.
Documentation suggests to replace FSGetVolumeParms() with -[NSURL getResourceValue:forKey:error:] at the Foundation level or with CFURLCopyResourcePropertyForKey() at the Core Foundation level. However, I couldn't find any key in NSURL/CFURL that would really provide the information I'm looking for.
There are no suggestions what to use at the POSIX level. I checked out statfs(), but it seems it doesn't help either; no particular information about support for "big" files, neither in struct statfs type, nor in its f_flags field. I've found something that suggests solution in "mount.h" header, flag VFS_TBL64BITREADY, but I don't want to go low to kernel level and I still don't know whether "file system 64-bit readiness" really means support for "big" files.
You are looking for getattrlist()
Search for VOL_CAP_FMT_2TB_FILESIZE in the man page ("If this bit is set the volume format supports file sizes larger than 4GB").
That said, if you don't want to drop down to the POSIX API, CFURL also provide a kCFURLVolumeMaximumFileSizeKey which look suited to your need. -- Jean-Daniel _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.app... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jean-Daniel Dupas