commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject [IO] FileUtils.doCopyFile - should behaviour be changed?
Date Mon, 03 Jun 2013 20:00:48 GMT
The private method FileUtils.doCopyFile is used by many of the public
FileUtils methods to do the actual file copying.

At present this caches the input file size at the start, and only
copies that many bytes to the output file.

If the input file is a log file, and is growing, it will only copy the
original size file.
However, if the output file size is not equal to the current file size
an exception is thrown.

This seems unnecessarily strict - and does not agree with
IOUtils.copy() methods which keep going until EOF.

I think it would make more sense for FileUtils.doCopyFile to behave
the same way, i.e. keep copying until EOF is reached.
In which case, the file size check should be eliminated - it does not
make sense to check the sizes if the input may to grow/shrink.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message