• 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
guess the file size of compressed file from the original
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: guess the file size of compressed file from the original
      • From: Graff <email@hidden>
  • Prev by Date: Re: Bizzare osascript/CodeWarrior behavior
  • Next by Date: Re: quit the dock - possible?
  • Previous by thread: Re: Finder Error when duplicating files and folders???
  • Next by thread: Re: guess the file size of compressed file from the original
  • Index(es):
    • Date
    • Thread