mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-22 19:10:41 -10:00
Previously on unix we would use stat to get information about directories and files for DirectoryInfo and FileInfo. That meant that we wouldn't correctly report ReparsePoint for symlinks, and the code was changed to use LStat. But that then breaks important use cases, such as by DirectoryInfo.Exist for a symlink to a directory always returning false. This commit provides a compromise: we first use lstat, and if we find it's a symlink, we use stat but remember separately that it's a symlink so we can include ReparsePoint in the reported attributes. Commit migrated from https://github.com/dotnet/corefx/commit/36259dc3c72fb1dc2a71a06db6f7dce9ea88c642