• 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
Best way to tell if a file copy has finished.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best way to tell if a file copy has finished.


  • Subject: Best way to tell if a file copy has finished.
  • From: email@hidden
  • Date: Tue, 2 Aug 2005 21:58:17 +1000

I have a script that must process files that appear in a folder, they are copied there from another mac across the network. I've seen a couple of methods for this in scripts I've found on the web. I did have one method that seemed to work well under Panther but it doesn't work under Tiger.

One method was to loop trying to move the file to another folder. Under Panther the move would fail until after the file had finished copying. Under Tiger the move succeeds resulting in a truncated file.

Another method was to loop testing the size of the file and not process it until the size stopped changing.

            set the item_size to the size of (info for this_item)
            repeat while item_size is not equal to the size of (info for this_item)
                set the item_size to the size of (info for this_item)
                delay 2
            end repeat

Under Tiger I have found that the file size remains at zero until the file has finished copying, so my script now loops while the file size is zero.

Does anyone have a better method that works on Tiger?

Thanks
JZ


John Zornig


http://www.johnzornig.com/


To update your address book with my new vCard, click the link below:

http://www.johnzornig.com/JohnZornig.vcf



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Best way to tell if a file copy has finished.
      • From: Jeff Porten <email@hidden>
  • Prev by Date: Re: Finder GUI Scripting
  • Next by Date: Extracting class of items from list
  • Previous by thread: vacation
  • Next by thread: Re: Best way to tell if a file copy has finished.
  • Index(es):
    • Date
    • Thread