News for hackers. Stuff that matters.
Re:Dotfile Madness by TeMPOraL on Monday October 24, 2022 @07:30AM (#33315338)
There's an important consideration 'ChrisSD mentions here[0], i.e. whether resolving ".." is done lexically or by querying the filesystem. You may get different answers in each case if e.g. you try to resolve /foo/bar/../baz, when /foo/bar is a symlink to a different directory.

At least in case of std::filesystem, everything in std::filesystem::path is purely lexical. So, to get actual parent of some path, you'll need to go through std::filesystem::directory_entry and std::filesystem::read_symlink().

--

[0] - https://news.ycombinator.com/item?id=33312712

There are no comments on this comment yet.