[jira] [Commented] (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&focusedCommentId=16810876#comment-16810876
 ] 

Gary Gregory commented on IO-386:
-

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)


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

2017-12-11 Thread Bernd Eckenfels (JIRA)

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

Bernd Eckenfels commented on IO-386:


You probably can compare it with the size at the beginning. Both seems to be 
rather strange, but comparing with the size after copy is less likely to fail 
when the file has changed meanwhile. If this is good or bad is a different 
question :)

Can you tell us what you need to get fixed?

> 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
(v6.4.14#64029)


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

2017-12-11 Thread zhipengxu (JIRA)

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

zhipengxu commented on IO-386:
--

Can we save the length before copy really start and compare it with the new 
generated file ? 
Does it really cannot be fixed?

> 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
(v6.4.14#64029)


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

2017-07-05 Thread Bernd Eckenfels (JIRA)

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

Bernd Eckenfels commented on IO-386:


After discussion in IO-544 I also wonder if the transferFrom returning 0 case 
does not need a few retries to avoid the length difference exception


> 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
(v6.4.14#64029)


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

2013-06-03 Thread Sebb (JIRA)

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

Sebb commented on IO-386:
-

A related issue: 
Why is the input file size refetched at the end? 
Why not re-use the original value?

> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira