Is copying files from Windows to Cygwin harmful?

1

  1. If I copy some files from windows to the /home folder of Cygwin, am I corrupting Cygwin file system?
  2. How about if some of these file are executable and I execute them in Cygwin /home folder?
  3. Should I change the access mode by chmod before executing the executable files?

Admia

Posted 2017-01-14T15:02:53.433

Reputation: 113

You should do a few tests to give yourself more clarity. You seem to be overthinking it as Cygwin is just a package of typical Unix utilities adapted and compiled to run on Windows. Therefore, the permissions are not identical to their POSIX equivalents. https://cygwin.com/cygwin-ug-net/using-filemodes.html can give you hints about this.

– Julie Pelletier – 2017-01-14T22:33:23.717

Answers

4

You would not be corrupting Cygwin if you copied files to /home. But you might prefer to let Cygwin put you in /home/{yourusername} and then create symlinks to your Windows' Documents, Pictures, etc.

ln -s /cygdrive/C/Users/yourusername/Documents
ln -s /cygdrive/C/Users/yourusername/Pictures
#...etc...

I should point out that Cygwin is different to WSL, where there are (or have been) dire warnings against copying anything from the Windows environment into the Linux subsystem environment. Cywin is not WSL and does not suffer from this file copying restriction.

roaima

Posted 2017-01-14T15:02:53.433

Reputation: 1 006

1@ roaima: Interesting. Both methods that you introduced means Cygwin can access to the files in Windows and read/write/execute them. – Admia – 2017-01-14T23:10:03.273

If you set db_home: windows as recommended in that other answer, you don't need the symlinks. That solution will work even if you modify /etc/fstab to change the cygdrive mount point, as I do on my Cygwin boxes so that C: is accessible as /c. Your symlinks would all have to be recreated on doing that. – Warren Young – 2017-01-16T15:34:47.440

@admia There is no separation between CygWin and Windows. CygWin just provides a different view (with a Unix flavour) onto exactly the same files/folders as Windows sees. – Tonny – 2017-01-16T15:56:24.227

@Admia you can even type notepad<ENTER> in cygwin and it will launch notepad. So it's a bit like a command prompt but with unixish features. In fact, cygwin used to be run from cmd.exe then cygwin.bat – barlop – 2017-01-16T16:04:42.160