Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Touch a file in objective-c

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

like image 387
grilix Avatar asked Dec 17 '22 09:12

grilix


1 Answers

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)

like image 142
AliSoftware Avatar answered Jan 02 '23 02:01

AliSoftware