Guest User

Untitled

a guest
Jun 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. NSTask *checksumTask = [[[NSTask alloc] init] autorelease];
  2. NSPipe *checksumPipe = [[[NSPipe alloc] init] autorelease];
  3. [checksumTask setStandardOutput:checksumPipe];
  4. NSFileHandle *readHandle = [checksumPipe fileHandleForReading];
  5. [checksumTask setLaunchPath:@"/usr/bin/openssl"];
  6. [checksumTask setArguments:[NSArray arrayWithObjects:
  7. @"dgst",
  8. @"-sha1",
  9. @"-binary",
  10. path,
  11. nil]];
  12. NSData *checksum = [readHandle readDataToEndOfFile];
  13. [checksumFile setObject:checksum forKey:[path lastPathComponent]];
Add Comment
Please, Sign In to add comment