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

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.


  • Follow-Ups:
    • Re: guess the file size of compressed file from the original
      • From: Bill <email@hidden>
References: 
 >Re: guess the file size of compressed file from the original (From: Bill <email@hidden>)

  • Prev by Date: display dialog time out problem
  • Next by Date: The Finder "Action" toolbar favorite
  • Previous by thread: Re: guess the file size of compressed file from the original
  • Next by thread: Re: guess the file size of compressed file from the original
  • Index(es):
    • Date
    • Thread