#filesystem path starting with ~ doesn't work

12 messages · Page 1 of 1 (latest)

dense tundra
#

as in the attached screenshot, the first path works fine, the second one doesn't (reversing it also breaks it, if both lack "~" it works just fine)

buoyant daggerBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

#

@dense tundra

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

woven cipher
#

I think it's because there is no such thing as ~ for home directory with std:: filesystem

median vale
#

That might be a feature of one's actual file system and not of std::filesystem

dense tundra
median vale
#

so what happens there is bash converts ~ into your home directory before sending the argument to cd

dense tundra
#

so it's bash doing the conversion? I always thought it's a special symbolic link

median vale
#

I compiled this basic program and this is the result when running it

#include <iostream>

int main(int argc, char** argv) {
    std::cout << argv[1];
}
$ ./a.out ~/temp/main.cpp
/home/{fullname}/temp/main.cpp
dense tundra