Home » U++ Library support » U++ Core » Windows ProgramData directory
Windows ProgramData directory [message #59108] |
Thu, 03 November 2022 10:45  |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi Mirek,
Could you add the following to Core/App.h:
String GetProgramDataFolder();
And Core/App.cpp:
String GetProgramDataFolder() { return GetShellFolder(CSIDL_COMMON_APPDATA);}
?
Best regards,
Tom
EDIT: And by the way, what would be the Linux equivalent for "C:\ProgramData"?
[Updated on: Thu, 03 November 2022 10:52] Report message to a moderator
|
|
|
|
Re: Windows ProgramData directory [message #59254 is a reply to message #59250] |
Mon, 05 December 2022 11:15   |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi,
I wish I (or someone else) could. I tried to search for anything suitable on the web without result.
How would you solve this 'ProgramData' for Linux? I.e. a path on local computer where all users can create/read/write/delete files like on a network share with sufficient privileges.
Should I just: 'sudo mkdir /var/programdata && sudo chmod 777 /var/programdata' and point to this directory within my programs?
(My programs use some files that may be updated by the programs themselves running at user level privileges. All users on the local computer and many of my programs use and update the same files, so there is no point keeping multiple copies on the disk for each program and/or each user. Windows ProgramData is just the right thing for this.)
Best regards,
Tom
|
|
|
|
Re: Windows ProgramData directory [message #59256 is a reply to message #59255] |
Tue, 06 December 2022 14:06   |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi,
Thanks Aris! (BTW, nice to hear from you after many years.)
Mirek, would you agree on this:
String GetProgramDataFolder() {
#ifdef WIN32
return GetShellFolder(CSIDL_COMMON_APPDATA);
#else
return String("/var/opt");
#endif
}
Best regards,
Tom
EDIT: Removed trailing slash from /var/opt.
BTW: Should it be called GetProgramDataFolder() or GetProgramDataDirectory()? Currently there is at least GetExeFolder(), GetHomeDirectory() and GetConfigFolder().
[Updated on: Wed, 07 December 2022 11:11] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 13:55:38 CEST 2025
Total time taken to generate the page: 0.01732 seconds
|