#filesystem path starting with ~ doesn't work
12 messages · Page 1 of 1 (latest)
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
Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!
I think it's because there is no such thing as ~ for home directory with std:: filesystem
https://en.cppreference.com/w/cpp/filesystem/path/path
example shows using one
That might be a feature of one's actual file system and not of std::filesystem
How do I check if it's a feature of my file system? "cd ~" works just fine
so what happens there is bash converts ~ into your home directory before sending the argument to cd
so it's bash doing the conversion? I always thought it's a special symbolic link
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
It works for me too
Yeah, did some more tests, I don't think it's possible to do it with "~", it always needs the full path