Coder Social home page Coder Social logo

Make sure directories exist about neonmodem HOT 1 CLOSED

0-wiz-0 avatar 0-wiz-0 commented on May 17, 2024
Make sure directories exist

from neonmodem.

Comments (1)

mrusme avatar mrusme commented on May 17, 2024

@0-wiz-0 neonmodem is getting these directories at this point, using Go's os package. Those function use the environment variables set by the user and return those values. As written in the documentation:

UserCacheDir returns the default root directory to use for user-specific cached data. Users should create their own application-specific subdirectory within this one and use that.

On Unix systems, it returns $XDG_CACHE_HOME as specified by https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html if non-empty, else $HOME/.cache. On Darwin, it returns $HOME/Library/Caches. On Windows, it returns %LocalAppData%. On Plan 9, it returns $home/lib/cache.

If the location cannot be determined (for example, $HOME is not defined), then it will return an error.

I don't believe it is a good idea for a random program to just create the directories that a user has specified as ENV, e.g. $XDG_CACHE_HOME, hence the one thing that I found sensible was to let neonmodem crash loudly, so that the user takes care to fix his ENV.

However, having that said, I haven't read deeper into especially the XDG/Freedesktop specification to understand whether programs should in fact create these directories if they're non-existent.

If you have any info that explicitly points out that neonmodem is not behaving in a standard way free to re-open the issue. :-)

from neonmodem.

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.