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 10:06:58 -0700
On Aug 12, 2013, at 8:51 AM, Dragan Milić <email@hidden> wrote:
> On pon 12.08.2013., at 17.17, Jim Luther wrote:
>
>> 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.
>
> Jim, thanks a lot! I was't careful while checking documentation so I was actually looking into NSURL and CFURL from OS X 10.6 documentation :-( kCFURLVolumeMaximumFileSizeKey and NSURLVolumeMaximumFileSizeKey are available as of 10.7. I'll probably remove 10.6 docs to avoid similar gaffes in the future.
>
>> 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.
>
> Yeah, in the meantime I've learned about getattrlist() POSIX/BSD API and VOL_CAP_FMT_2TB_FILESIZE. Since the rest of the code I'm working on is mostly in plain C, I'll stick to that. Also, the man page for pathconf() doesn't mention _PC_FILESIZEBITS system variable. Perhaps it should be updated.
Not all file systems support pathconf(path, _PC_FILESIZEBITS) and not all support VOL_CAP_FMT_2TB_FILESIZE. That's why my code checks both.
I wrote a bug to cover the man page: <rdar://problem/14713078> man page for pathconf(2) needs an update for additional defined variable names
- Jim
> Thanks again.
>
> -- 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