[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

changenotify - determine when a file has been closed.

sean_n

4/19/2008 1:20:00 AM

1 Answer

Tim Pease

4/19/2008 11:10:00 PM

0

On Apr 18, 2008, at 7:25 PM, Sean Nakasone wrote:

> Is there a way to determine when a file has been closed? I know the
> changenotify module can determine when a file is written to, but I
> need to know when it has been closed. The file is a postscript file
> being created by a printer driver and I want to make a copy of it
> when the file is done being written to.
>


A quick way to do this would be the directory_watcher gem. It watches
files in a directory and notifies you when those files change -- add,
modified, deleted. There is a fourth file notification event called
"stable" -- this is sent when the file has remained un-modified for X
amount of time.

<http://codeforpeople.rubyforge.org/directory_wa...

It's all ruby code, so it should work on Windows and Unix equally well.

Blessings,
TwP