Closed e-e-e closed 4 years ago
Oh dang. The folder is created as part of universal-localstorge I was trying to figure out a unified API for tracking saved keys between the browser and Node.
The actual Dat data storage is using universal-dat-storage. It uses the env-paths module to find storage on your platform for the app. On Windows it's inside ~/AppData/Roaming/Dat
, on MacOS it's on ~/Library/Application Support/dat
, and on Linux it should be somewhere in ~/.local
. You can find more details in the source of that module. :) https://github.com/sindresorhus/env-paths/blob/master/index.js
It might be worth forking that module in this case. It looks relatively simple, and also kind of unmaintained. That would enable this SDK to have more control over the generation of temp files, and most importantly also clean up after itself.
I might have time to do it next week, but in the meantime, a PR with a forked version of the module would be very much appreciated. 💜
Is the fork necessary? Because it would be another module to maintain. env-paths
has a property to access a temporal directory. Maybe the only thing to consider is the portability of using something like this. But this would only be a concern if we consider other dat ports like datcxx or the rust version (which are on an early stage).
Why it's not being cleaned after use it is because it's not treated as a temporal directory. dats are being stored in the user's home and the home dir is obtained by using env-paths
.
:v:
@dpaez I think what @e-e-e meant was that they'd fork the universal-localstorage module to prevent it from creating this uls_scratch
directory, not that they'd fork env-paths.
alright, that is way better ^_^
Messing with this now. Planning to make it store in the same place as the dats
I am a bit confused. I am trying to create a new dat with via the promise syntax and it is creating a directory
uls_scratch
within my current working directory, but apparently not creating a folder for storing the dat data.What is this directory and why is it not cleaned up? Where is the actually data getting stored? Or does this use RAM?