[jira] [Comment Edited] (IO-386) FileUtils.doCopyFile uses different methods to check the file sizes

2019-04-05 Thread Gary Gregory (JIRA)


[ 
https://issues.apache.org/jira/browse/IO-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16810876#comment-16810876
 ] 

Gary Gregory edited comment on IO-386 at 4/5/19 2:37 PM:
-

Won't this become moot if we call {{Files.copy(Path,Path,CopyOptions)}} within 
this API?


was (Author: garydgregory):
This will become moot if we call {{Files.copy(Path,Path,CopyOptions)}} within 
this API.

> FileUtils.doCopyFile uses different methods to check the file sizes
> ---
>
> Key: IO-386
> URL: https://issues.apache.org/jira/browse/IO-386
> Project: Commons IO
>  Issue Type: Bug
>Reporter: Sebb
>Priority: Minor
>
> FileUtils.doCopyFile uses FileChannel.size() to measure the input file length 
> at the start, and File.length() to compare the lengths at the end.
> This is inconsistent.
> If there is a good reason for this it should be documented, otherwise it 
> should probably use the same method for all the checks.
> [Note: is FileChannel.size() accurate if the file has not been flushed?]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (IO-386) FileUtils.doCopyFile uses different methods to check the file sizes

2019-04-05 Thread Gary Gregory (JIRA)


[ 
https://issues.apache.org/jira/browse/IO-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16810876#comment-16810876
 ] 

Gary Gregory edited comment on IO-386 at 4/5/19 2:22 PM:
-

This will become moot if we call {{Files.copy(Path,Path,CopyOptions)}} within 
this API.


was (Author: garydgregory):
This will become moot when we update to Java 8 where we can call 
{{Files.copy(Path,Path,CopyOptions)}} within this API.

> FileUtils.doCopyFile uses different methods to check the file sizes
> ---
>
> Key: IO-386
> URL: https://issues.apache.org/jira/browse/IO-386
> Project: Commons IO
>  Issue Type: Bug
>Reporter: Sebb
>Priority: Minor
>
> FileUtils.doCopyFile uses FileChannel.size() to measure the input file length 
> at the start, and File.length() to compare the lengths at the end.
> This is inconsistent.
> If there is a good reason for this it should be documented, otherwise it 
> should probably use the same method for all the checks.
> [Note: is FileChannel.size() accurate if the file has not been flushed?]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)