round(0, "ermintrude") succeeded instead of producing a TypeError. Fix this.
[python.git] / Mac / BuildScript / seticon.m
blob04e3d7dbdb468f7dff2b8bbac0c681919c88bf1a
1 /*
2  * Simple tool for setting an icon on a file.
3  */
4 #import <Cocoa/Cocoa.h>
5 #include <stdio.h>
7 int main(int argc, char** argv)
9         if (argc != 3) {
10                 fprintf(stderr, "Usage: seticon ICON TARGET");
11                 return 1;
12         }
14         NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
15         NSString* iconPath = [NSString stringWithUTF8String:argv[1]];
16         NSString* filePath = [NSString stringWithUTF8String:argv[2]];
18         [NSApplication sharedApplication];
20         [[NSWorkspace sharedWorkspace]
21                 setIcon: [[NSImage alloc] initWithContentsOfFile: iconPath]
22                 forFile: filePath
23                 options: 0];
24         [pool release];
25         return 0;