• 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
Re: can't run app from applications folder -- permissions problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can't run app from applications folder -- permissions problem?


  • Subject: Re: can't run app from applications folder -- permissions problem?
  • From: Ben Dougall <email@hidden>
  • Date: Tue, 18 Apr 2006 13:59:17 +0100


On Tuesday, April 18, 2006, at 12:34 am, Ondra Cada wrote:

Ben,

On 18.4.2006, at 1:18, Ben Dougall wrote:

On Apr 17, 2006, at 6:19 PM, Ben Dougall wrote:

sh: /Applications/: is a directory

here's the line that calls the command line utility:

system( [[NSString stringWithFormat:@"%@/CpMac -p %@ %@", [[NSBundle mainBundle] resourcePath], origFile, backupTmpFile] cString] );

That last %@ in the format should be %s, since you're passing a C string there.

the cString applies to the whole thing between the system( [[....] cString] ) brackets so that's not it unfortunately.

Well, re-write to

NSString *cmd=[NSString stringWithFormat .... ];
NSLog(@"About to perform: [%@]",cmd);
int exit=system([cmd UTF8String]); // better somewhat than the rightly deprecated cString
NSLog(@"exit %d",exit);


With these printouts, you should be able to determine the cause of the error (which most probably is the well-known dodginess of system you explicitly did not care about :))

thanks. i've found out what it was now (no quotes around the paths and spaces in the paths).


is UTF8String OK for passing as command lines? is that what i should use instead of cString?

thanks, ben.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: can't run app from applications folder -- permissions problem?
      • From: Christian Stieber <email@hidden>
References: 
 >Re: can't run app from applications folder -- permissions problem? (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Can add and delete items in coredata, but not change them
  • Next by Date: Re: can't run app from applications folder -- permissions problem?
  • Previous by thread: Re: can't run app from applications folder -- permissions problem?
  • Next by thread: Re: can't run app from applications folder -- permissions problem?
  • Index(es):
    • Date
    • Thread