PDA

View Full Version : File Handling in Cocoa




naveen.rv
Jul 8, 2009, 06:16 AM
I am working on an application which stores data in a flat file, but the data in delicate, though i can encode it, i want these files NOT to be deleted by any other user, than the one created it, is this possible in cocoa programming in Objective-C.


Thank you.



gnasher729
Jul 8, 2009, 07:12 AM
I am working on an application which stores data in a flat file, but the data in delicate, though i can encode it, i want these files NOT to be deleted by any other user, than the one created it, is this possible in cocoa programming in Objective-C.

Check the Cocoa documentation for handling files; if you don't find anything, check out what Posix says. In the end, the administrator of the computer can delete any file.

naveen.rv
Jul 8, 2009, 07:41 AM
Hey got it thanks :)

1. Use NSFileManager

2. Set the Attribute mask in the method

- (BOOL)changeFileAttributes:(NSDictionary *)attributes atPath:(NSString *)path;