2010-08-18 86 views

回答

6

要立即更新的filePath的修改時間標記(它是,例如,在ls -l輸出示出)以:

NSError* error; 
NSFileManager* fileManager = [NSFileManager defaultManager]; 

if (![fileManager setAttributes:@{NSFileModificationDate:[NSDate date]} 
        ofItemAtPath:filePath 
          error:&error]) { 
    NSLog(@"Couldn't update modification date: %@", error); 
}