Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temp dir #93

Closed
comtihon opened this issue Apr 12, 2017 · 5 comments
Closed

temp dir #93

comtihon opened this issue Apr 12, 2017 · 5 comments

Comments

@comtihon
Copy link

hi!
It will be very useful (at least for me), if there would be user_temp_dir or system_temp_dir.
Are there any plans to add one?
Thanks!

@zoofood
Copy link
Contributor

zoofood commented May 14, 2017

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.

@comtihon
Copy link
Author

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.

@nugget
Copy link

nugget commented May 14, 2017

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.

@mortenlj
Copy link

mortenlj commented Nov 8, 2017

Isn't this in most cases already solved by tempfile from the standard library?
https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir

@zoofood
Copy link
Contributor

zoofood commented Jul 31, 2018

Already supported by standard library in python 2 and 3.

@zoofood zoofood closed this as completed Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants