[Gloucs] "Is the file completed" in bash

Rayner gloslug at sariel.anarres.org
Wed Jul 13 11:36:50 BST 2005


On Wed, 13 Jul 2005, Paul Broadhead wrote:

> Glyn Davies <glynd at walmore.com> wrote:
> 
> > What's the best way in a script of determining that a file has been 
> > finished being written to before going on to process it? I'm writing a
> > script to rename user backup files to something more meaningful but 
> > obviously, I don't want to rename a file part way through its
> > creation.

[sorry to piggyback this on someone else's reply, I inadvertantly 
deleted the original]

If you have the 'lsof' or 'fuser' commands installed, you could use 
either of them to find out whether the file is currently opened by any 
processes.

Regards,
Rayner


-- 
And now I see with eye serene
The very pulse of the machine               -- William Wordsworth



More information about the gloucs mailing list