I tried searching for something here but it said my words were to common, so it ignored them.
Being new to Linux/Ubuntu I wanted to ask if there is a preferred directory for saving data files from an application?
Thanks, RodG.
Proper Directory for saving data files.
- BruceSteers
- Posts: 1572
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Proper Directory for saving data files.
you'll want the .config dir in your home directory i should think, use a folder in there with the same name as your application...
User.Home &/ ".config" &/ Application.Name
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: Proper Directory for saving data files.
You can also save the data file in the same directory as your program.
Myself I tend to save my data files in the folder as my program..
Application.path &/ Application name
Or you can save it to a dedicate folder like Bruce suggested.Myself I tend to save my data files in the folder as my program..
Re: Proper Directory for saving data files.
Thanks, didn't want to head down a road that could turn bumpy later.
I can see where each of these could be a preferred method over the other depending on the type of data being saved.
I can see where each of these could be a preferred method over the other depending on the type of data being saved.
Re: Proper Directory for saving data files.
Consider the scope of your data.
If it is ephemeral, i.e. pertinent only to an instance of your project, then store it using the Gambas Temp mechanism.
If it is pertinent to the user running the project then store it somewhere in "~". As Big B Bruce says you can use the .config/gambas3 dir but I generally shy away from that for purity reasons.
If it is pertinent only to the project you MAY store it in the project directory. However, you MUST understand relative pathing if you do that, otherwise you will get totally confused later. Also you must understand the Gambas project directory structure.
If it is system wide, then store it in a shareable directory, for example /srv.
The only data I store in the project directory is project metadata and then only after considerable thinking about what data might go in there at a later date.
I have spoken.
b
If it is ephemeral, i.e. pertinent only to an instance of your project, then store it using the Gambas Temp mechanism.
If it is pertinent to the user running the project then store it somewhere in "~". As Big B Bruce says you can use the .config/gambas3 dir but I generally shy away from that for purity reasons.
If it is pertinent only to the project you MAY store it in the project directory. However, you MUST understand relative pathing if you do that, otherwise you will get totally confused later. Also you must understand the Gambas project directory structure.
If it is system wide, then store it in a shareable directory, for example /srv.
The only data I store in the project directory is project metadata and then only after considerable thinking about what data might go in there at a later date.
I have spoken.
b
Have you ever noticed that software is never advertised using the adjective "spreadable".