Hello... A small question for today: I am making a little test application that takes the directory contents at a certain path and then deletes the file that was changed most recently.
This is what I have so far:
This is what I have so far:
Code:
NSString *thepath = [self path]; //path is /Users/mathcolo/hello/
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *fileContents = [fm directoryContentsAtPath:thepath];
NSString *filepath;
int i;
for (i=0; i<[fileContents count]; i++) {
//Do something with the files here or something
}