• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Reading the executable from the executable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Reading the executable from the executable
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: option-click hides apps
  • Next by Date: Re: Defining a constant as private
  • Previous by thread: Re: Defining a constant as private
  • Next by thread: Re: Reading the executable from the executable
  • Index(es):
    • Date
    • Thread