Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSTask *checksumTask = [[[NSTask alloc] init] autorelease];
- NSPipe *checksumPipe = [[[NSPipe alloc] init] autorelease];
- [checksumTask setStandardOutput:checksumPipe];
- NSFileHandle *readHandle = [checksumPipe fileHandleForReading];
- [checksumTask setLaunchPath:@"/usr/bin/openssl"];
- [checksumTask setArguments:[NSArray arrayWithObjects:
- @"dgst",
- @"-sha1",
- @"-binary",
- path,
- nil]];
- NSData *checksum = [readHandle readDataToEndOfFile];
- [checksumFile setObject:checksum forKey:[path lastPathComponent]];
Add Comment
Please, Sign In to add comment