• 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: mkdir in shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkdir in shell script


  • Subject: Re: mkdir in shell script
  • From: Chuck Soper <email@hidden>
  • Date: Mon, 23 Aug 2004 15:08:48 -0700

Because it doesn't work for me, Mr. Take the path of least resistance (I'm only joking). I'm not trying to create intermediate directories and I have read the man page. At the time the script is executed all of the intermediate directories exist.

The following two line shell script build phase (not a script file) echoes the path correctly, but the mkdir does not create the directory. If I copy the mkdir command with the expanded directory path from the build log and paste it into a terminal session then it executes fine, the directory is created. Could this be a permissions issue?

echo "$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/data"
mkdir -p "$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/data"

Chuck


At 1:47 PM -0700 8/23/04, Dave Camp wrote:
On Aug 23, 2004, at 1:07 PM, Chuck Soper wrote:

At 11:40 AM -0600 8/23/04, Nick Zitzmann wrote:
On Aug 23, 2004, at 10:29 AM, Chuck Soper wrote:

What is the proper way to create a sub-directory via a shell script build phase? I'd like to write: if sub-directory doesn't exist then mkdir path. Can someone help me with this Unix command? (I think I could always call mkdir and have it error out 99% of the time, but that doesn't seem very clean to me.)

Instead of doing all that, why not just use 'mkdir -p' and be done with it...

From man mkdir:
     -p      Create intermediate directories as required.  If this option is
             not specified, the full path prefix of each operand must already
             exist.  On the other hand, with this option specified, no error
             will be reported if a directory given as an operand already
             exists.  Intermediate directories are created with permission
             bits of rwxrwxrwx (0777) as modified by the current umask, plus
             write and search permission for the owner.

Dave
---
The path of least resistance, it's not just for electricity any more.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >mkdir in shell script (From: Chuck Soper <email@hidden>)
 >Re: mkdir in shell script (From: Nick Zitzmann <email@hidden>)
 >Re: mkdir in shell script (From: Chuck Soper <email@hidden>)
 >Re: mkdir in shell script (From: Dave Camp <email@hidden>)

  • Prev by Date: Re: mkdir in shell script
  • Next by Date: Re: mkdir in shell script
  • Previous by thread: Re: mkdir in shell script
  • Next by thread: Re: mkdir in shell script
  • Index(es):
    • Date
    • Thread