• 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: SnowLep & FolderActions - Reposted
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SnowLep & FolderActions - Reposted


  • Subject: Re: SnowLep & FolderActions - Reposted
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 9 Sep 2009 14:31:00 -0700

On Sep 9, 2009, at 5:07 AM, Mark J. Reed wrote:

As far as I understand, that's to the price of a 3 seconds delay, isn't it?

I believe so -- it's supposed to wait until the size remains the same for 3 seconds.


That's still heuristic, and no better than we can do in user code. Why not trigger when the creating file descriptor is closed?

Among other reasons, because there isn't necessarily a file descriptor to watch. Folder actions often are set to watch a folder on a remote server; in that case, the server's kernel owns the file descriptor, not yours. And the point remains that while it's no better than you *can* do in user code, this way you don't have to, or risk doing it wrong.


There's really no completely reliable way to tell whether or not a file is "done" being written, even if the file is just a file -- if it's actually a bundle, then it's even more complicated. The delay is a heuristic, and it's not a bad one, but it can still be fooled by sufficient lag in the copy process, say over a slow network connection. If you feel the need to tune it, you can change the wait time using "defaults write com.apple.FolderActionsDispatcher granularity x", where "x" is the number of seconds. The default, by the way, is five seconds, not three.


--Chris Nebel AppleScript Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: SnowLep & FolderActions - Reposted
      • From: Tom Robinson <email@hidden>
References: 
 >Re: SnowLep & FolderActions - Reposted (From: Emmanuel LEVY <email@hidden>)
 >Re: SnowLep & FolderActions - Reposted (From: Shane Stanley <email@hidden>)
 >Re: SnowLep & FolderActions - Reposted (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: SnowLep & FolderActions - Reposted
  • Next by Date: Re: [ANN] AppleScriptObjC sample
  • Previous by thread: Re: SnowLep & FolderActions - Reposted
  • Next by thread: Re: SnowLep & FolderActions - Reposted
  • Index(es):
    • Date
    • Thread