in reply to how to tell if a file is still being modified
Along the same lines of what halley had to say in his reply I once solved that problem by using an algorithm described in the following psuedocode:
Another scheme I have used in the past is to let the FTP client that is putting the files into the directory bit-twiddle the permission bits so that when the client is done copying the permission bits are of some pre-agreed upon value, (444 being my favorite) and then opening the file.open file for reading slurp in file into a scalar close file calculate the MD5 of slurp buffer wait X seconds open file for reading slurp into second scalar close file calculate MD5 of second slurp buffer compare and repeat if not equal.
Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: how to tell if a file is still being modified
by bunnyman (Hermit) on Sep 16, 2003 at 14:12 UTC | |
by blue_cowdawg (Monsignor) on Sep 16, 2003 at 15:56 UTC | |
Re: Re: how to tell if a file is still being modified
by Aighearach (Initiate) on Sep 18, 2003 at 10:39 UTC |