[Gllug] Checking if a file has finished being written?

Huw Lynes huw-l at moving-picture.com
Mon Jan 27 16:10:04 UTC 2003


On Mon, 27 Jan 2003 14:22:17 -0000
Andy Young <andy.young at bbc.co.uk> wrote:

> Hi all,
> 
> I wonder if anyone can tell me a way to check in a shell script if a file
> has finished being written?
> 
> I want to automatically transcode from one type of video to another, but
> there is a likely chance of hitting a file mid write if I just do this on a
> timed basis.
> 
> I unfortunately have no control over the source application setting some
> sort of flag file to show the write is complete.
> 
> Any advice much appreciated.
> 
> Andy.
> 
> Andy Young
> Design Systems Administrator
> BBC Post Production
> 

One way to do this (a bit more complicated than you are looking for I think) is the SGI file alteration monitor. http://oss.sgi.com/projects/fam/links.html  

Sadly you really have to communicate with it using the C API provided, however there are python bindings for it. I only mention this because 
A: it's rock solid.
B: it is a very powerful tool for the long term, if you need more than just a quick hack.

-- 
| Huw Lynes               | The Moving Picture Company  |
| System Administrator    | 127 Wardour Street          |
|.........................| London, W1F 0NL             | 



-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list