Cygwin convert environment paths

Steven Penny
Sun May 10 12:42:16 GMT 2020

I see here:


That Cygwin does convert some environment variables, from Windows format to
Unix format. For example HOME and TMP. But for me at least, are some important

I use APPDATA and PROGRAMFILES a good amount, and those arent converted. To make
it worse, HOMEDRIVE and SYSTEMDRIVE arent converted either, meaning you cant
manually construct the path starting with a variable. This causes some
problems. Take this example:

    $s_old = realpath('a.txt');
    $s_new = getenv('HOMEDRIVE') . DIRECTORY_SEPARATOR . 'a.txt';
    # PHP Warning:  symlink(): No such file or directory
    symlink($s_old, $s_new);

More information about the Cygwin mailing list