Re: guess the file size of compressed file from the original
Re: guess the file size of compressed file from the original
- Subject: Re: guess the file size of compressed file from the original
- From: Graff <email@hidden>
- Date: Sat, 26 Jun 2004 18:25:14 -0400
On Jun 26, 2004, at 12:38 PM, Bill wrote:
Here it is in AppleScript:
----
set sourceFile to (choose file)
set sourcePosix to quoted form of (POSIX path of sourceFile)
set dittoSize to do shell script "/usr/bin/ditto -c -k --sequesterRsrc
" & sourcePosix & " - | wc -c"
{(size of (info for sourceFile)) as integer, dittoSize as integer}
----
Thanks a lot, you're so helpful :) Actually, my script is derived from
your suggestion in another thread a few weeks ago ;)
My task is to compress file or folder into *.zip with a size less than
5MB, if the original one is too big, make several *.zip. Do you know
is there any shell command, or applescript can do it?
Are you trying to retain any folder hierarchy that existed before you
archived or can the files just be put in any sort of order? Does it
have to be a zip file or are you just archiving things without a need
for a specific archive format? In other words, can you use a disk
image (dmg) file instead of a zip file?
If you don't care about zip files then I would go for a disk image and
use the shell tool hdiutil to archive things. You can create one large
dmg and then split it into 5MB segments. All of your folder hierarchy
would be retained and the files can be compressed at the same time.
What is the eventual purpose of doing this? Will you need to be able
to open each zip file individually or are you splitting them up and
then planning to re-join them before un-archiving them?
- Ken
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.