Code Monkey home page Code Monkey logo

Comments (5)

mortenlj avatar mortenlj commented on July 25, 2024 2

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.

zoofood avatar zoofood commented on July 25, 2024

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.

comtihon avatar comtihon commented on July 25, 2024

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.

nugget avatar nugget commented on July 25, 2024

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.

zoofood avatar zoofood commented on July 25, 2024

Already supported by standard library in python 2 and 3.

from appdirs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.