Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Windows ProgramData directory
Windows ProgramData directory [message #59108] Thu, 03 November 2022 10:45 Go to next message
Tom1
Messages: 1212
Registered: March 2007
Senior 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 #59250 is a reply to message #59108] Sat, 03 December 2022 15:48 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Tom1 wrote on Thu, 03 November 2022 10:45
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"?


Gladly, if you can answer your question Smile
Re: Windows ProgramData directory [message #59254 is a reply to message #59250] Mon, 05 December 2022 11:15 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior 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 #59255 is a reply to message #59254] Tue, 06 December 2022 01:11 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
Some ideas:
Quote:

If you want to strictly follow the FHS, then /var/opt/<appname> for the data of apps installed in /opt is the right place to go. Stuff installed in /usr/local typically just used /var/lib/<appname>.

--
The difference between /var/opt and /var/lib (or similarly between /opt and /lib) is usually whether any particular package comes from the standard OS repository or manually downloaded and installed/compiled by the administrator. Again usually what ends up in opt folders is purchased non-free programs and 3rd party software not installed by the OS package manager. Those programs and software usually have their own way of self-management, e.g. satisfying library dependencies, un-installation, etc.



from : https://serverfault.com/questions/262006/var-opt-vs-var-lib

Regards, Aris
Re: Windows ProgramData directory [message #59256 is a reply to message #59255] Tue, 06 December 2022 14:06 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior 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

Re: Windows ProgramData directory [message #59266 is a reply to message #59256] Thu, 08 December 2022 12:27 Go to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
Tom1 wrote on Tue, 06 December 2022 13:06
Hi,

Thanks Aris! (BTW, nice to hear from you after many years.)



Thanks, Tom! I really appreciate your welcoming words. Btw, have you seen this? Smile https://www.ultimatepp.org/forums/index.php?t=msg&th=119 76&goto=59264&#msg_59264
Previous Topic: Way to decode websocket frames?
Next Topic: WebSocket client SSL support?
Goto Forum:
  


Current Time: Fri Mar 29 12:22:00 CET 2024

Total time taken to generate the page: 0.01465 seconds