Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-386

FileUtils.doCopyFile uses different methods to check the file sizes

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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?]

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sebb Sebb
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: