Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to properly copy symlink files

In order to deploy an application, I have to copy the files located in C:\cygwin\dev into my destination folder.

Here are the files in that folder, they are symlinks :

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

When I copy/paste the files from Windows explorer I have no issue :

enter image description here

But my problem is when I copy them from command line, they are always empty.
I tried several ways to copy them, like :

cp -Prv * /cygdrive/c/dest/folder/
cp -RvL * /cygdrive/c/dest/folder/
cp -RPav * /cygdrive/c/dest/folder/
tar cvf - . | (cd /cygdrive/c/dest/folder/ && tar xvf -)

And with all of these commands, I get empty files :
enter image description here

I would really need to copy these files by using command line. Do you know why I can’t correctly copy these files ?

Thanks a lot for your help.

>Solution :

Just tried this using Git Bash and copying them using "cp -R" works fine. It might be because your CygWin is only 32 bit and GitBash is 64bit. Should note as those files look like device files they’re always going to be symlinks even if you try to disassociate with -L.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading