[osx] file copy completed?

hey folks,

does anybody know how to determine if a given file is still being copied? i’m writing a batch processor to work on big video files – and the software likes reading the files before they’ve finished copying over.

i’m not sure if this is a file thing, a directory thing – or a system thing. The only lead I have is using unix’s lsof command to see which files are currently open, but that seems like overkill (would have to sort through 100s of files).

thanks for any advice/direction on this,

jeremy

Try looking at the copy functionality via Poco:

http://pocoproject.org/slides/080-Files.pdf

http://pocoproject.org/documentation/index.html

Cheers,

Joel

Thanks, Joel, I’ll take a look at this.

The copying will actually be done outside of the oF app, but it looks like the I might be able to use some of Poco’s File class’ functionality to determine if a file has finished copying.

It seems likely that the file modification date will be extremely useful.

All the best,

Jeremy

So File::getSize() does the trick.

If the value doesn’t change after a few consecutive readings, it’s probably safe to say that it’s finished copying.

Thanks!