/filesystems/grabfs/Cocoa/main.m

http://macfuse.googlecode.com/ · Objective C · 31 lines · 19 code · 8 blank · 4 comment · 2 complexity · ec958ce60123b0ceafec4d9e16861713 MD5 · raw file

  1. /*
  2. * Copyright Amit Singh. All Rights Reserved.
  3. * http://osxbook.com
  4. */
  5. #import <Cocoa/Cocoa.h>
  6. int
  7. main(int argc, char *argv[])
  8. {
  9. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  10. NSString *bin = [[NSBundle mainBundle] pathForResource:@"grabfs"
  11. ofType:NULL];
  12. NSString *icns = [[NSBundle mainBundle] pathForResource:@"GrabFSVolume"
  13. ofType:@"icns"];
  14. const char *bin_utf8 = [bin UTF8String];
  15. const char *icns_utf8 = [icns UTF8String];
  16. char volicon_arg[4096];
  17. snprintf(volicon_arg, 4096, "-ovolicon=%s", icns_utf8);
  18. if (fork() == 0) {
  19. execl(bin_utf8, bin_utf8, volicon_arg, NULL);
  20. }
  21. [pool release];
  22. exit(0);
  23. }