Skip to content

Filesystem location per user (for configuration data, or otherwise) #23

@MarkDBlackwell

Description

@MarkDBlackwell

If there are any other features you'd like, let me know, I'll do what I can to add them :)

Here's a relevant StackOverflow question. Quoting JP:

In Mac OS X I'll put user-specific files for my app in ~/Library/Application Data/{{MyApp}}/ and in Unix I'll put them in ~/.{{MyApp}}/ — where should I put them for Windows?

and quoting mikel's answer:

On Windows, it's ENV['APPDATA']

which I interpret as File.join((File.expand_path ENV['APPDATA']), '{{MyApp}}'). For me, this results in:

C:/Users/Mark/AppData/Roaming/{{MyApp}}

(For the above occurrences of {{MyApp}}, we should substitute the actual name of the application—of course.)

So, a cross-platform method, whose purpose would be to return the location where we should place user-specific files, perhaps optionally with (or without) the suffixes /{{MyApp}}/ or /.{{MyApp}}/, would be useful, and simple to use. (Also, IMO it falls in the bailiwick you've undertaken with this gem.)

Presumably, an attempt should be made to match existing practice. Often on Windows (in particular), configuration files (which comprise just one of the many kinds of user-specific files targeted by this suggested feature) are placed in one of two locations: ENV['APPDATA'] or ENV['HOMEPATH'].

BTW, when running the RubyInstaller's Ruby, the result of ENV['HOME'] seems set to the same location as ENV['HOMEPATH'].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions