Re: ATTR_CMN_CHGTIME
Re: ATTR_CMN_CHGTIME
- Subject: Re: ATTR_CMN_CHGTIME
- From: "gMail.com" <email@hidden>
- Date: Mon, 22 Mar 2010 08:52:04 +0100
- Thread-topic: ATTR_CMN_CHGTIME
Hi Ron,
You speak about the modification date of the "content of the file".
I am speaking about the modification date of the "attributes of the file".
It gets modified when you change the ownership or the permissions or the
lock flag...
You can get it with lstat and sb.st_ctime or with FSSetCatalogInfo and
kFSCatInfoAttrMod or with getattrlist and ATTR_CMN_CHGTIME
Regards
--
Leonardo
> Da: Ron Fleckner <email@hidden>
> Data: Mon, 22 Mar 2010 10:20:44 +1100
> A: "gMail.com" <email@hidden>
> Cc: <email@hidden>
> Oggetto: Re: ATTR_CMN_CHGTIME
>
>
> On 22/03/2010, at 10:01 AM, gMail.com wrote:
>
>> Hi,
>> I cannot find a Cocoa API to set the "Attribute Modification Date"
>> of a
>> file. If there is a way, may you please let me know?
>>
>> In the meantime, on MacOS X 10.5.8, I have been trying to use
>> setattrlist
>> with ATTR_CMN_CHGTIME, unsuccessfully. And setattrlist returns 0, as
>> everything went ok. While it is not ok. Even FSSetCatalogInfo with
>> kFSCatInfoAttrMod doesn't work. I get the current date/time I call
>> the API,
>> not the date/time I have set.
>>
>> So my question is:
>> Can I really set the ATTR_CMN_CHGTIME on MacOS X 10.5.8 or higher?
>>
>> 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?
>>
>>
>> Thanks
>> --
>> Leonardo
>
> Hi Leonardo,
>
> the Cocoa way, I suppose, is to use NSFileManager. Looks like you can
> use setAttributes:ofItemAtPath:error: with an NSDate value for
> NSFileModificationDate.
>
> Ron
>
_______________________________________________
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