Created
October 5, 2012 00:24
-
-
Save mariash/3837319 to your computer and use it in GitHub Desktop.
FileUtils copy with preserve and symlink issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy with preserve updates metadata of file and if file that symlink points to has not been copied yet it fails | |
require "fileutils" | |
`mkdir ./src` | |
`touch ./src/foo` | |
# Important that symlink name goes before source name in alphabetical order (bar points to foo) | |
`ln -s ./src/foo bar` | |
# Copy fails - No such file or directory - ./dest/bar | |
FileUtils.cp_r("./src", "./dest", :preserve => true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment