Re: Determining when a file has finished copying

2008-07-19 Thread Wilbert Berendsen
You could also copy to a different name on the same disk, and when the copying has been finished just 'move' (mv) the file to the filename the other application expects. E.g. QMail works this way, writing incoming mails in folders. Met vriendelijke groet, Wilbert Berendsen -- http://www.wilbe

Re: Determining when a file has finished copying

2008-07-14 Thread Ethan Furman
Michiel Overtoom wrote: Ethan wrote: One more option may be to attempt to rename the file -- if it's still open for copying, that will fail; success indicates the copy is done. Caveat -- this is dependent on the operating system! Windows will indeed not allow you to rename or delete a fil

Re: Determining when a file has finished copying

2008-07-14 Thread Michiel Overtoom
Ethan wrote: > One more option may be to attempt to rename > the file -- if it's still open for copying, that will fail; > success indicates the copy is done. Caveat -- this is dependent on the operating system! Windows will indeed not allow you to rename or delete a file that's still open f

Re: Determining when a file has finished copying

2008-07-14 Thread Ethan Furman
Sean DiZazzo wrote: On Jul 9, 5:34 pm, keith <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control ov

Re: Determining when a file has finished copying

2008-07-12 Thread Larry Bates
Sean DiZazzo wrote: On Jul 9, 5:34 pm, keith <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the

Re: Determining when a file has finished copying

2008-07-11 Thread Sean DiZazzo
On Jul 9, 5:34 pm, keith <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > Ethan Furman wrote: > > writeson wrote: > >> Guys, > > >> Thanks for your replies, they are helpful. I should have included in > >> my initial question that I don't have as much control ove

Re: Determining when a file has finished copying

2008-07-10 Thread Cameron Simpson
On 10Jul2008 13:20, Manuel Vazquez Acosta <[EMAIL PROTECTED]> wrote: | Cameron Simpson wrote: | > On 09Jul2008 15:54, Ethan Furman <[EMAIL PROTECTED]> wrote: | >> The solution my team has used is to monitor the file size. If the file | >> has stopped growing for x amount of time (we use 45 secon

Re: Determining when a file has finished copying

2008-07-10 Thread Manuel Vazquez Acosta
Cameron Simpson wrote: > On 09Jul2008 15:54, Ethan Furman <[EMAIL PROTECTED]> wrote: >> The solution my team has used is to monitor the file size. If the file >> has stopped growing for x amount of time (we use 45 seconds) the file is >> done copying. Not elegant, but it works. > > If you kn

Re: Determining when a file has finished copying

2008-07-09 Thread Cameron Simpson
On 09Jul2008 15:54, Ethan Furman <[EMAIL PROTECTED]> wrote: > The solution my team has used is to monitor the file size. If the file > has stopped growing for x amount of time (we use 45 seconds) the file is > done copying. Not elegant, but it works. If you know that files appear in sequence

Re: Determining when a file has finished copying

2008-07-09 Thread Larry Bates
keith wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the program that writes (pgm-W) as I'd like. Otherwise, the writ

Re: Determining when a file has finished copying

2008-07-09 Thread keith
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: > writeson wrote: >> Guys, >> >> Thanks for your replies, they are helpful. I should have included in >> my initial question that I don't have as much control over the program >> that writes (pgm-W) as I'd like. Otherwise, the write

Re: Determining when a file has finished copying

2008-07-09 Thread Ethan Furman
writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the program that writes (pgm-W) as I'd like. Otherwise, the write to a different filename and then rename solution would work great. There's no wa

Re: Determining when a file has finished copying

2008-07-09 Thread Daniel Mahoney
> Thanks for your replies, they are helpful. I should have included in > my initial question that I don't have as much control over the program > that writes (pgm-W) as I'd like. Otherwise, the write to a different > filename and then rename solution would work great. There's no way to > tell from

Re: Determining when a file has finished copying

2008-07-09 Thread Larry Bates
writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the program that writes (pgm-W) as I'd like. Otherwise, the write to a different filename and then rename solution would work great. There's no wa

Re: Determining when a file has finished copying

2008-07-09 Thread writeson
Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the program that writes (pgm-W) as I'd like. Otherwise, the write to a different filename and then rename solution would work great. There's no way to tell from the

Re: Determining when a file has finished copying

2008-07-09 Thread norseman
Also available: pgm-W copies/creates-fills whatever B/dummy when done, pgm-W renames B/dummy to B/F pgm-D only scouts for B/F and does it thing when found Steve [EMAIL PROTECTED] Manuel Vazquez Acosta wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This seems a synchronization pro

Re: Determining when a file has finished copying

2008-07-09 Thread Larry Bates
writeson wrote: Hi all, I'm writing some code that monitors a directory for the appearance of files from a workflow. When those files appear I write a command file to a device that tells the device how to process the file. The appearance of the command file triggers the device to grab the origin

Re: Determining when a file has finished copying

2008-07-09 Thread Manuel Vazquez Acosta
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This seems a synchronization problem. A scenario description could clear things up so we can help: Program W (The workflow) copies file F to directory B Program D (the dog) polls directory B to find is there's any new file F In this scenario, program

Determining when a file has finished copying

2008-07-09 Thread writeson
Hi all, I'm writing some code that monitors a directory for the appearance of files from a workflow. When those files appear I write a command file to a device that tells the device how to process the file. The appearance of the command file triggers the device to grab the original file. My proble