Skip to content

Instantly share code, notes, and snippets.

@skahack
Created July 28, 2011 05:55
Show Gist options
  • Save skahack/1111045 to your computer and use it in GitHub Desktop.
Save skahack/1111045 to your computer and use it in GitHub Desktop.
NSFileVersionTest.m
// clang -o nsFileVersionTest nsFileVersionTest.m -lobjc -framework Cococa
#import <Cocoa/Cocoa.h>
void applicationMain()
{
NSURL *url = [NSURL fileURLWithPath:@"/Users/SKAhack/Desktop/Test.txt" isDirectory:NO];
NSArray *versions = [NSFileVersion otherVersionsOfItemAtURL:url];
for (NSFileVersion *f in versions) {
NSLog(@"URL : %@", f.URL);
NSLog(@"localizedName : %@", f.localizedName);
NSLog(@"localizedNameOfSavingComputer : %@", f.localizedNameOfSavingComputer);
NSLog(@"modificationDate : %@", f.modificationDate);
}
}
int main(int argc, char *argv[])
{
id pool = [[NSAutoreleasePool alloc] init];
applicationMain();
[pool release];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment