signaling when a file is closed

Tony Nelson tonynelson at georgeanelson.com
Tue Feb 21 01:49:14 UTC 2006


At 8:45 AM -0800 2/20/06, Andrew B. Young wrote:
>If this is OT feel free to direct me elsewhere.
>
>I need to know when a process as finished writing
>a file and has closed it.  My only clue is fuser,
>which somehow knows what processes have files open.
>
>Is there a way for me to set a signal on a file's
>state that lets me know when it has been closed?

Simple, stupid way: the previous file is closed when the next file is started?


>Some background--
>
>I have a MRI machine that runs GE's canned software
>which writes out one new file of image data per second
>in a known directory.  I need to stream this data
>into another process in near-real-time.
>
>Using [id]notify I can watch the directory and know
>when a new file is created. But I need to know when
>the file has been closed by the writing process such
>that there is no more data to be read.

I don't know beans about any of this, but the first Google hit on "linux
file closed monitor" brings up an IBM page on inotify that shows code that
tells when a file is closed.
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson at georgeanelson.com>
      '                              <http://www.georgeanelson.com/>




More information about the users mailing list