Re: Determine if a file system supports files > 4GB
Re: Determine if a file system supports files > 4GB
- Subject: Re: Determine if a file system supports files > 4GB
- From: Jim Luther <email@hidden>
- Date: Mon, 12 Aug 2013 08:17:59 -0700
Dragan,
The property to request from -[NSURL getResourceValue:forKey:error:] is NSURLVolumeMaximumFileSizeKey; the property to request from CFURLCopyResourcePropertyForKey() is kCFURLVolumeMaximumFileSizeKey. These properties return the largest file size (in bytes) supported by this file system, or NULL is returned if this cannot be determined.
The value returned is determined with pathconf(path, _PC_FILESIZEBITS) (if the file system supports it), or the volume capability VOL_CAP_FMT_2TB_FILESIZE (if the file system supports it); otherwise, NULL is returned. Those are the POSIX/BSD layer ways to get the information -- we just made it easy for you at the NS/CFURL layer. In addition, the value returned is more accurate than the bSupports2TBFiles attribute.
- Jim
On Aug 12, 2013, at 7:00 AM, Dragan Milić <email@hidden> wrote:
> Hi,
>
> I'm very new to this list and local web search doesn't seem to be working at the moment, so I apologise if this topic has already been tackled.
>
> 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.
>
> I know I can hard-code a list of known file types which support "big" files and use struct statfs fields f_fstypename and/or f_type, but I wouldn't consider that as a reliable approach.
>
> -- Dragan
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Filesystem-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden