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

Doug Winter doug at pigeonhold.com
Mon Jan 27 14:52:56 UTC 2003


On Mon 27 Jan Andy Young wrote:
> 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.

It's a bit of a kludge, but you could use fuser to see if a process
still has the file open.  This could potentially introduce race
conditions though, so be careful.

Cheers,

Doug.

-- 
<fourstar> sigmata - being scarred from a particularly poor .sig
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20030127/a348a0b7/attachment.pgp>


More information about the GLLUG mailing list