grilix
grilix

Reputation: 5341

Touch a file in objective-c

I need to update the modification time of a file from a cocoa application. Any suggestion?

Upvotes: 4

Views: 1104

Answers (1)

AliSoftware
AliSoftware

Reputation: 32681

Use NSFileManager's setAttributes:ofItemAtPath:error: method with the NSFileModificationDate attribute.

(See the class reference but also the associated "File System Programming Guide" which is worth reading)

Upvotes: 13

Related Questions