• 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: Monitor Folder For Changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monitor Folder For Changes


  • Subject: Re: Monitor Folder For Changes
  • From: Jeffrey Mattox <email@hidden>
  • Date: Wed, 18 Dec 2002 17:36:00 -0600

I am trying to write a script which will monitor a folder and copy any files which are newly added or updated to another location. So far, I have a folder action script which launches when a file is added to the folder. I check the creation date of files in the folder and copy recently-created files to another folder.
The problem is this:
the files are very large so they take a minute or two to copy. During this time, another file or files might be added to the folder, in which case they are ignored by my script once it is done copying. Is there some way I can avoid missing any changes to the folder as far as new/updated files? I'm hoping someone has a ready-made script which does just this, since it seems like a generally useful tool.

FWW

You could just loop back to the beginning and repeat your test, doing that until there is no more work to do.

Here's some pseudo code:

set didWork to true
repeat while (didWork is true)
set didWork to false
repeat with theFile in (every file of thefolder)
if ( theFile is new ) then
-- copy the new file here
set didWork to true
end if
end repeat
end repeat

Jeff
_______________________________________________
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.

  • Prev by Date: Re:Efficient Sort Routine....
  • Next by Date: Re: BIG number as string
  • Previous by thread: Monitor Folder For Changes
  • Next by thread: Re: Monitor Folder For Changes
  • Index(es):
    • Date
    • Thread