Re: can't run app from applications folder -- permissions problem?
Re: can't run app from applications folder -- permissions problem?
- Subject: Re: can't run app from applications folder -- permissions problem?
- From: "Lawrence Sanbourne" <email@hidden>
- Date: Mon, 17 Apr 2006 18:04:55 -0500
Could this be a problem with quoting? I'm wondering whether the
bundle's resource path needs to be quoted within the string:
system( [[NSString stringWithFormat:@"\"%@/CpMac\" -p \"%@\" \"%@\"", [[NSBundle
mainBundle] resourcePath], origFile, backupTmpFile] cString] );
Note that in this case, if the path contains double quotes or new
lines, you're in trouble. You probably want to take each of the path
strings and run a method on them (maybe in a category on NSString)
that escapes special characters as needed.
-ls
On 4/17/06, Ben Dougall <email@hidden> wrote:
> i'm running a couple of command line utilities from two system() calls
> (i know it's a dodgy function but it's not a serious/proper app). the
> command line utilities are inside my app's bundle. when running the app
> while writing and building it no problem. but once i've built it and
> put it in my apps folder then the command line calls aren't working i
> don't think. i get this when the app is run from in the applications
> folder:
>
> 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] );
>
> i'm not a 100% the above sh: line/error is coming from the above system
> call but i think it is. is this be a permissions problem? if i drag my
> app out of the applications folder and run it from the desktop for
> example it doesn't give the above 'is a directory' line. any ideas?
>
> 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