[futurebasic] Re: [FB] Command line from FB to archive a file

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2006 : Group Archive : Group : All Groups

From: Steve <mactech@...>
Date: Fri, 17 Nov 2006 19:23:34 -0500
Ken,

thanks a lot for the info !!!

next ?  how about zippin' a folder :)

TIA

On Nov 17, 2006, at 7:17 PM, Ken Shmidheiser wrote:

> Steve asked:
>
>> I want to have OS X create an archive file [.zip] and call it from  
>> FB.  I can do it with AppleScript, but it is too complicated and  
>> prone to errors.
>>
>> Maybe Ken has done this with a Unix call ?
>> I want to compress a file, before FTP upload via curl.
>
>
> Short answer:
>
> ditto -c -k -X --rsrc ~/Desktop/myfile  ~/Desktop/myfile.zip
>
> curl -T ~/Desktop/myfile.zip ftp://userID:password@/subdir/myfile.zip
>
>
>
> Long answer:
>
> Prior to 10.4 the standard Unix utilities were Mac resource fork  
> unfriendly. Commands like cp (copy) have been cleaned up in OS X  
> 10.4 and resource forks are now preserved. I like ditto for its  
> backward compatibility and inherent ability to create a zip file  
> and honor resource forks. (Note that you must append the ".zip"  
> suffix to the outgoing file.)
>
> Run this little one-liner (it may wrap here, but it it should all  
> be on one line) from the Terminal to test the concept. It will  
> create a small text file to the Desktop and zip it:
>
>
> echo "Zip me up">~/Desktop/zipper.txt; ditto -c -k -X --rsrc ~/ 
> Desktop/zipper.txt ~/Desktop/zipper.zip
>
>
> While you can unzip the file with ditto, you can also do it with OS  
> X's faceless BOMArchiveHelper app with this simple command:
>
>
> open ~/Desktop/zipper.zip
>
>
> This protects against overwriting the original file, in this case  
> creating a new "zipper 2.txt" file.
>
> In more complicated cases, remember that Unix uses POSIX file  
> paths, utiltiies for which were shown in other examples here.
>
> HTH.
>
> Ken
>
> --
> To unsubscribe, send ANY message to: futurebasic- 
> unsubscribe@...
>