Reputation: 529
Problem: I'm writing some code that is portable to Linux and Cygwin (compiled on msys), and the handling of symlinks is different. On Cygwin, if I create a symlink in the normal way, with a default Cygwin shell (ie. the CYGWIN
envvar not set):
$ ln -s foo bar
then fopen(bar)
doesn't follow the symlink. The first line of text appears to be !<symlink>.
and my code reports that the opened file isn't UTF-8.
I can fix this by running Cygwin as admin, setting CYGWIN
to winsymlinks:nativestrict
, deleting the symlink, and re-creating it. However, this isn't ideal: in my case, the symlinks are created by Subversion from the Linux codebase, so I now need to script the link delete and remake after every update.
CYGWIN
?Thanks.
Edit
Ok, I think the answer is basically here, on the MinGW mailing list, from 2007. If you compile with MinGW you can't use Cygwin native symlinks. Maybe the situation has changed since 2007?
Upvotes: 0
Views: 151