• 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: Help with "ditto"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with "ditto"


  • Subject: Re: Help with "ditto"
  • From: Dale Jensen <email@hidden>
  • Date: Fri, 29 Aug 2008 12:43:16 -0500

On Aug 29, 2008, at 12:29 PM, Randall Meadows wrote:

On Aug 29, 2008, at 11:19 AM, Dale Jensen wrote:

I sure wish that some of these command line tools had weird names so that google was more helpful.

If I have a file that I've compressed with ditto and navigate to it in the Finder and double click on it, it extracts the file in the same directory, as expected.

If, however, I use NSTask to send "ditto -x -k Resume080622.docx.zip Resume080622.docx" (assuming proper directories, of course,) ditto creates a folder with the name "Resume080622.docx" and then puts the file in that. This screws up a lot of things, as you can imagine. Any idea what I have to do or what argument to pass to get it to extract just the file, not embedded in another folder.

According to the fourth form described by 'man ditto', you are explicitly giving a destination directory, so you're getting exactly what you asked for!


Instead of specifying the file name where you want the output to go (which is wrong, according to the man page), specify the directory where you want the output to go, which should be "." (meaning the current directory).

ditto -x -k Resume080622.docx.zip .


Thanks, that fixed it for those singleton files. However, now it breaks packages (puts the contents of the packages into the directory instead of into the "package directory".) With the previous rendition, packages worked perfectly. Aside from tracking what's in the archive, any ideas on what I need to change to have both types of files unzip correctly (packages into a same named folder, singletons into no folder)?

Thanks again,


dale

--
Dale Jensen, CEO
Ntractive, LLC
email@hidden
http://www.ntractive.com

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Help with "ditto" (From: Dale Jensen <email@hidden>)
 >Re: Help with "ditto" (From: Randall Meadows <email@hidden>)

  • Prev by Date: Bindings: Specifying the Class of a Controller’s Content
  • Next by Date: Re: Bindings: Specifying the Class of a Controller’s Content
  • Previous by thread: Re: Help with "ditto"
  • Next by thread: Bindings: Specifying the Class of a Controller’s Content
  • Index(es):
    • Date
    • Thread