• 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: "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

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

  • Prev by Date: Re: C# to Objective-C translator?
  • Next by Date: Re: can't run app from applications folder -- permissions problem?
  • Previous by thread: 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