sbt / io

IO module for sbt
Apache License 2.0
40 stars 45 forks source link

Add hardLink to CopyOptions and related copyFile/copyDirectory helpers #326

Closed er1c closed 2 years ago

er1c commented 2 years ago

This is interesting to "copy" files from a cache location to another working directory, without making actual IO copies of the files. The java API Files.createLink uses a hardlink (rather than a symbolic link) to do this. It also seems to be supported on Windows, so that's the extra plus. Creating links for a directory are discouraged, so this does it as the individual file level.

eed3si9n commented 2 years ago

If something needs a hard link, probably best to be implemented on its own via NIO or something rather calling it copy. Closing this for now.