Comments (5)
Isn't this in most cases already solved by tempfile
from the standard library?
https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir
from appdirs.
Hi Comithon,
I'm not really clear on how we could set the proper defaults particularly on linx/Mac. For example on linux /tmp and /var/tmp are recommended for inter-process communications, not for temp files in general. We could use the user_data_dir potentially? Not really sure of all the implications here.
Windows is straight forward though. I'd have to look into macOS.
I'd love to hear some opinions on this for the various platforms before I code it up.
from appdirs.
Hi,
From my point of view - system_temp_dir
should use ``something like /tmp
on linux/mac. I don't know if same directory exists in Windows.
And `user_temp_dir` should rely on user_data_dir.
from appdirs.
According to the Linux FHS, /tmp and /var/tmp would both be appropriate. /tmp is available "for programs that require temporary files" and /var/tmp/ is the same for files that are expected to survive a reboot.
macOS shares the same definitions (according to man hier
) with /tmp defined simply as "temporary files" and /var/tmp defined as 'temporary files that are kept between system reboots."
I would expect in both cases for code to honor the contents of the TMP or TEMP environment variable first (if that exists) and fall back on /tmp or /var/tmp secondarily. For user temp directory in macOS the contents of TMPDIR should be used, which is dynamically generated by the OS as a secure location only accessible by the current user.
from appdirs.
Already supported by standard library in python 2 and 3.
from appdirs.
Related Issues (20)
- Documentation examples for `user_config_dir` HOT 3
- Calls to appdirs functions fail on Jython in Windows if Java doesn't have JNA
- user_runtime_dir HOT 1
- user_config_dir vs Python from MS Store? HOT 1
- Getting write permission to site directories? HOT 4
- Breaking (and breaking pip) in MinGW Python running on Windows Server 2008 HOT 2
- Provide provide possibility to overwrite "user cache" location with env variable on linux HOT 3
- Startup path is not there
- App name is duplicated on Windows if author name is missing or None HOT 6
- pywintypes.com_error: "Can't find the specified path" on Windows
- Behavior inside a Flatpak sandbox?
- Add a note directing users to platformdirs HOT 3
- Does it support Android? HOT 1
- fix one-sentence summary in docstring for `site_config_dir`
- License parsing HOT 1
- feature: Support "well known" user directories HOT 1
- Branch names release vs. master
- macOS `user_config_dir` goes against OS guidelines
- Deprecate notice
- N
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appdirs.