Re: ATTR_CMN_CHGTIME
Re: ATTR_CMN_CHGTIME
- Subject: Re: ATTR_CMN_CHGTIME
- From: "gMail.com" <email@hidden>
- Date: Mon, 22 Mar 2010 10:59:26 +0100
- Thread-topic: ATTR_CMN_CHGTIME
Hi Ken,
thanks, I have read those lines on the man. But where are these Carbon APIs
setting the Attribute Date? I tried FSSetCatalogInfo with kFSCatInfoAttrMod
and it didn't work. I ended up with an attribute date equal to the current
time (when I called the API), not the date I wanted to set.
On the man page "getattrlist"
http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPag
es/10.5/man2/getattrlist.2.html?useVersion=10.5
is clearly written that the ATTR_CMN_CHGTIME flag is read/write, so I should
be able to set it. But I can't really. And setattrlist returns 0, as
everything has been set well, while it has been not.
Furthermore, on the man page "setattrlist"
http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPag
es/10.5/man2/setattrlist.2.html?useVersion=10.5
is written "You must own the file system object in order to set any of the
following attributes:" ATTR_CMN_GRPID, ATTR_CMN_ACCESSMASK, ATTR_CMN_FLAGS,
ATTR_CMN_CRTIME, ATTR_CMN_MODTIME, ATTR_CMN_CHGTIME, ATTR_CMN_ACCTIME
I don't know whether I own this "file system object". I don't even know
what's that and how should I own it, but for sure, I can quite set the
ATTR_CMN_CRTIME and the ATTR_CMN_MODTIME, so I presume I own this "file
system object".
Any idea?
--
Leonardo
> Da: Ken Thomases <email@hidden>
> Data: Mon, 22 Mar 2010 03:35:52 -0500
> A: "gMail.com" <email@hidden>
> Cc: <email@hidden>
> Oggetto: Re: ATTR_CMN_CHGTIME
>
> On Mar 21, 2010, at 6:01 PM, gMail.com wrote:
>
>> Also, the man says that getattrlist and setattrlist don't work on all the
>> volumes. So, how can I know whether I can call these APIs?
>
> The man page for getattrlist says:
>
>> The best way to test whether a volume supports this function is to simply
>> call it and check the error result. getattrlist() will return ENOTSUP if it
>> is not supported on a particular volume.
>
> The man page for setattrlist says:
>
>> Not all volumes support setattrlist(). However, if a volume supports
>> getattrlist(2), it must also support setattrlist(). See the documentation
>> for getattrlist(2) for details on how to tell whether a volume supports it.
>
> It also says:
>
>> The functions are only supported by certain volume format implementations.
>> For maximum compatibility, client programs should use high-level APIs (such
>> as the Carbon File Manager) to access file system attributes. These
>> high-level APIs include logic to emulate file system attributes on volumes
>> that don't support setattrlist() and fsetattrlist().
>
> Cheers,
> Ken
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden