Folders and files currently scattered across $TMP include "cudatext" and "cudatext_addon_man" directries, and the FIFO "tuniqueinstance_someone_cudatext.0" and "cudatext_download.html" when the user checks for app updates.
I wish CudaText (or FreePascal?) would accept an environment variable (say CUDATEXT_TEMP) holding a directory name for ALL of its runtime/temp files. I would set 'export CUDATEXT_TEMP=/mytemp/cudatext' for example. Or the path could be relative to the cudatext app directory, or depend upon another env var like 'export CUDATEXT_TEMP="${MYTEMPSTUFF}/cudatext"' for example.
A command-line parameter could also work. Many apps offer both, with the command line having highest precedence, then env vars. If I have missed such options, please educate me.
Thanks!
Dir for Temp and Runtime Files Set by User
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: Dir for Temp and Runtime Files Set by User
IMO adding CUDATEXT_TEMP var is redundant. no one will it it except maybe you. so better fix the current paths.
let's use one folder temp/cudatext.
most of temp content is created by AddonsManager plugin, so if you know python, you can give the the patch?
files tuniqueinstance* are exception maybe - they are good in temp/.
let's use one folder temp/cudatext.
most of temp content is created by AddonsManager plugin, so if you know python, you can give the the patch?
files tuniqueinstance* are exception maybe - they are good in temp/.
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: Dir for Temp and Runtime Files Set by User
wait, don't make the patch - I will try it myself.
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: Dir for Temp and Runtime Files Set by User
I updated AddonManager in git.
pls get it from there, and test.
https://github.com/Alexey-T/CudaText/tree/master/app/py
pls get it from there, and test.
https://github.com/Alexey-T/CudaText/tree/master/app/py
-
- Posts: 22
- Joined: 13.07.2024 21:19
Re: Dir for Temp and Runtime Files Set by User
FIFOs probably belong in "${XDG_RUNTIME_DIR}/cudatext" on Linux.main Alexey wrote: ↑05.09.2024 04:26 files tuniqueinstance* are exception maybe - they are good in temp/.
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: Dir for Temp and Runtime Files Set by User
FIFOs? first in first out? this is the temp file created by uniqInstance code.
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: Dir for Temp and Runtime Files Set by User
it is OK to create this temp-file in temp-dir - on non-Linux we may not have ${XDG_RUNTIME_DIR} at all.
-
- Posts: 22
- Joined: 13.07.2024 21:19
Re: Dir for Temp and Runtime Files Set by User
I just used 'file' to identify it. I will look at the uniqInstance code later.main Alexey wrote: ↑06.09.2024 04:18 FIFOs? first in first out? this is the temp file created by uniqInstance code.
Code: Select all
$ file cudatext_unique_myuser_cudatext.0
cudatext_unique_myuser_cudatext.0: fifo (named pipe)
True enough. Even on Linux there may not be a $TMP environment variable. I had a hard time getting that env var to 'stick' and not disappear for various reasons. I still suggest any 'runtime' files live in a subdirectory of their own, like $TMP/cudatext/runtime/cudatext_unique_myuser_cudatext.0main Alexey wrote: ↑06.09.2024 07:19 it is OK to create this temp-file in temp-dir - on non-Linux we may not have ${XDG_RUNTIME_DIR} at all.
Thanks!
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: Dir for Temp and Runtime Files Set by User
i fear that using of Temp-dir for uniqInstance is hardcoded in TSimpleIPCServer component in the FPC folder. i did not find any places where temp-dir is used in uniqInstance.