0

For copying large files, I would like to try replacing in my shell scripts cp by cpio, because I hope to be able to fine-tune the performance by specifying explicit buffer sizes. The current development environment is Zsh on Cygwin on Windows 7, but by solution should also run on Linux.

My original copy command is

cp //some.share/some/file local_dir

I replaced it by

cpio -null -pd local_dir <<<//some.share/some/file

and I get the error message

//some.share/some/file: Invalid cross-device link

This surprises me. Why does cpio attempt to create a hard link here? After all, it is supposed to copy the file, not link to it!

I'm aware that I'm misusing cpio somewhat, in that cpio is supposed to copy archives, not individual files, but from my understanding of the -p command line switch, I thought that I could use it also for just copying files.

user1934428
  • 19,864
  • 7
  • 42
  • 87
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Jan 26 '17 at 08:34
  • @jww : Sorry, but I think it **is** about programming. I am writing a shell script, and I want to use a certain command in this script, which does not perform as I would like to. My guess is that I got some options wrong. If this is not programming, what then would be? – user1934428 Jan 26 '17 at 12:42

0 Answers0