Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

IO.copyFile fails with larger files on Windows #491

Closed
retronym opened this Issue · 3 comments

2 participants

@retronym
Owner
java.io.IOException: Map failed
        at sun.nio.ch.FileChannelImpl.map(Unknown Source)
        at sun.nio.ch.FileChannelImpl.transferFromFileChannel(Unknown Source)
        at sun.nio.ch.FileChannelImpl.transferFrom(Unknown Source)
        at sbt.IO$$anonfun$copyFile$3$$anonfun$apply$3.apply(IO.scala:458)
        at sbt.IO$$anonfun$copyFile$3$$anonfun$apply$3.apply(IO.scala:457)
        at sbt.Using.apply(Using.scala:25)
        at sbt.IO$$anonfun$copyFile$3.apply(IO.scala:457)
        at sbt.IO$$anonfun$copyFile$3.apply(IO.scala:456)
        at sbt.Using.apply(Using.scala:25)
        at sbt.IO$.copyFile(IO.scala:456)
        at build$$anonfun$copyToUnmanagedJar$2.apply(build.scala:326)

Seems like:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4469299

Possible workaround:

http://dzone.com/snippets/java-filecopy-using-nio

Or by avoiding NIO on the Windows platform for file copying.

@harrah
Owner

Does the workaround work for you?

@retronym
Owner

We just used FileUtils.copyFile instead from Apache Commons IO rather than call the sbt copy function directly from our build. But we still hit this error intermittently when SBT internally used the NIO copy.

@harrah harrah closed this in b6b7861
@harrah
Owner

IO.copyFile now limits the maximum size transferred by one call to NIO. To verify on your system, io/test-only sbt.CopySpec for file sizes up to 256 MB. Change MaxFileSizeBits in CopySpec to test larger sizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.