toitlang / toit

Program your microcontrollers in a fast and robust high-level language.
https://toitlang.org/
GNU Lesser General Public License v2.1
1.23k stars 81 forks source link

On Windows: Toit can't read symbolic links that have "/" in the target-path. #2090

Open floitsch opened 9 months ago

floitsch commented 9 months ago

After creating a symbolic link that points to "../foo.txt", Toit can't read that file anymore. Replacing the '/' with '\' is enough to make it work.

Powershell and bash correctly manage to read the file. In fact they don't even show the difference for the two symlinks.

floitsch commented 9 months ago

Toit has also problems if we use the path that readlink gives back for absolute paths.

import host.file

main: 
  file.link --file --source="foo.txt" --target="c:\\some\\absolute\\path"
  current-link := file.readlink "foo.txt"  // => \??\c:\some\absolute\path
  file.link --file --source="foo2.txt" --target=current-link
  file.read-content "foo2.txt"  // => ERROR