guess the file size of compressed file from the original
guess the file size of compressed file from the original
- Subject: guess the file size of compressed file from the original
- From: Bill <email@hidden>
- Date: Sat, 26 Jun 2004 01:37:57 +0800
Hello all,
The shell command ditto can compress file and preserve the resource
forks, so, is it possible to guess the file size of the compressed
*.zip from the original file, by applescript?
eg.:
set sourceFile to (choose file)
set tmpZip to (POSIX path of (path to desktop) & "archive.zip")
do shell script "/usr/bin/ditto -c -k --sequesterRsrc " & quoted form
of (POSIX path of sourceFile) & space & tmpZip
{size of (info for sourceFile), size of (info for (tmpZip as POSIX file
as alias))}
-- {2.4258E+4, 1.9357E+4}
sourceFile is a pdf, size is 24KB, size of the archive.zip is ~20KB
In other words, given the file type & using ditto, can we estimate the
size of zipped file?
{kind:"PDF Document",size:2.4258E+4} => {kind:"ZIP archive", size: ?}
TIA
bill
_______________________________________________
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.