MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / Home

Method Home

MonaBase/sources/FileSystem.cpp:41–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40
41FileSystem::Home::Home() {
42#if defined(_WIN32)
43 // windows
44
45 const char* path(Util::Environment().getRaw("HOMEPATH"));
46 if (path) {
47 if (!Util::Environment().getString("HOMEDRIVE", *this) && !Util::Environment().getString("SystemDrive", *this))
48 assign("C:");
49 append(path);
50 } else if (!Util::Environment().getString("USERPROFILE", *this)) {
51 clear();
52 return;
53 }
54#else
55 struct passwd* pwd = getpwuid(getuid());
56 if (pwd)
57 assign(pwd->pw_dir);
58 else {
59 pwd = getpwuid(geteuid());
60 if (pwd)
61 assign(pwd->pw_dir);
62 else if(!Util::Environment().getString("HOME", *this)) {
63 clear();
64 return;
65 }
66 }
67#endif
68
69 MakeFolder(*this);
70}
71
72
73FileSystem::CurrentApp::CurrentApp() {

Callers

nothing calls this directly

Calls 1

getStringMethod · 0.45

Tested by

no test coverage detected