diff options
| author | Dan Engelbrecht <[email protected]> | 2025-01-10 09:56:33 +0100 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2025-01-10 09:56:33 +0100 |
| commit | be24af604c26cca81d4b6d4f1789238884c7a12d (patch) | |
| tree | 670f0552468398e6c60edfe2c8667275feb34e90 /src/zencore/filesystem.cpp | |
| parent | partial macos implementation (diff) | |
| download | zen-be24af604c26cca81d4b6d4f1789238884c7a12d.tar.xz zen-be24af604c26cca81d4b6d4f1789238884c7a12d.zip | |
get home folder
Diffstat (limited to 'src/zencore/filesystem.cpp')
| -rw-r--r-- | src/zencore/filesystem.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp index 52f2c4adc..3aa2dd0e1 100644 --- a/src/zencore/filesystem.cpp +++ b/src/zencore/filesystem.cpp @@ -1755,6 +1755,14 @@ PickDefaultSystemRootDirectory() #endif // ZEN_PLATFORM_WINDOWS } +std::filesystem::path +GetUserHomeFolder() +{ + int UserId = getuid(); + const passwd* Passwd = getpwuid(UserId); + return std::filesystem::path(Passwd->pw_dir); +} + ////////////////////////////////////////////////////////////////////////// // // Testing related code follows... |