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

FileUtils.doCopyFile uses different methods to check the file sizes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.12.0
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: