Reading the executable from the executable
Reading the executable from the executable
- Subject: Reading the executable from the executable
- From: Louis Sinclair <email@hidden>
- Date: Wed, 16 Jun 2004 08:44:07 -0500
Hi All,
I have a need for my application to read it's own executable. I'm getting
the path and opening the file with the following code:
NSBundle* bundle = [NSBundle mainBundle];
NSString* path = [[NSString alloc] initWithString:[bundle executablePath]];
FILE* fp = fopen([path cString], "rb");
It all works fine for the primary user of the Machine with admin
rights. However, the fopen command fails for any other users, even those
with admin rights. The Unix file flags on the file indicate that all users
should have read access to the file.
Is there any way for this to work regardless of user setup?
Thanks in advance.
--
Louis Sinclair
Minnetonka Audio Software, Inc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.