Code Monkey home page Code Monkey logo

app-dirs-rs's Introduction

app-dirs-rs's People

Contributors

agersant avatar andybarron avatar jackpot51 avatar koute avatar micahzoltu avatar urcra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

app-dirs-rs's Issues

Rename functions

They're kind of terrible, and I think I have a better scheme now:

  • app_dir -> ensure_app_dir
  • get_app_dir -> compute_app_dir

Discussion is very welcome...

Add option to enable author property on *nix

I don't think I see this feature anywhere? I read the source and it says it's disabled on *nix because specs don't require it. I'm learning Rust and porting a DLang application and all my DLang applications us

.config/<Author>/<Application>

Thanks!

Type of this value must be known in this context on 1.25.0-nightly

โฏ rustc -V
rustc 1.25.0-nightly (79a521bb9 2018-01-15)

I receive the error

error[E0619]: the type of this value must be known in this context
  --> /Users/tylerthrailkill/.cargo/registry/src/github.com-1ecc6299db9ec823/app_dirs-1.1.1/src/imp/platform/macos.rs:10:40
   |
10 |         Ok(Component::RootDir.as_ref().into())
   |                                        ^^^^

error: aborting due to previous error

error: Could not compile `app_dirs`.
warning: build failed, waiting for other jobs to finish...
error: build failed

when attempting to compile my application using app_dirs with 1.25.0-nightly

Allow using the XDG dirs on macOS.

Often command line tools on macOS use unix locations for dotfiles, I essentially never look in ~/Library/ to configure my tools. Because of this, I've avoided this crate for my personal projects because I want my dotfiles in ~/.config. Being able to configure this would make this much more useful to me.

Add temporary directory

Hi,

Would it be possible to add a temporary folder to this package?
This is not part of the XDG Base specification but would be very usefull to have in a cross-platform setting.

UserData on Windows should be local.

On Windows, AppData may be synced over the network on login/logout. Because of this, it is not recommended to store large user data in it and instead only store small config data. Since there is a separate entry for UserConfig, I believe the correct place for UserData is in LocalAppData (where you currently put UserCache).

Store data correctly on Windows.

On Windows, shared data should go in %ProgramData%. I don't remember the programmatic name off hand (on my phone at the moment), but it does have one.

Disable author ?

Hey,

Is it possible to have xx/Appname not xx/Author/Appname ?

Thanks

Consider using SHGetKnownFolderPath on Windows

Technically, this is the official way to get system paths, rather than reading from %[LOCAL]APPDATA%.

Gotta love Windows. ๐Ÿ˜

Add functions for accessing/creating files

  • get_app_file would be identical to get_app_dir.
  • app_file would:
    • Call create_dir_all on the path's parent.
    • Call OpenOptions::new().create(true).append(true).open on the full path.
    • Return the full path.
  • Could definitely consider combining get_app_dir and get_app_file into get_app_path and deprecating the old names. But I think that confuses the API. Even if the difference between get_app_dir and get_app_file is purely semantic, it's good (IMO) to mirror the difference between app_dir and app_file.

Make `AppInfo` own its strings.

Some of us want to make a library that uses app_dirs to manage data but lets the user of the library specify the strings for the application using it. Forcing this to be a &'static str instead of a String is a pain and also seems to not really gain us anything.

AppInfo stores strings incorrectly

The AppInfo struct stores the &'static str type, which fails miserably if any of the fields are borrowed from an owned String. It should be changed to use an explicit generic lifetime parameter and store the string slices with that lifetime.

Does it `sanitize` reserved name like CON or COM1 on Windows?

Clicking at [src] in the documentation does not show any special handling of things like

CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9

(source)

Note that it can also be complexier like aux.txt

Is it because of online documentation isn't for windows or it is not handled?

Support iOS

I have no idea if this is even plausible, but it'd be cool ๐ŸŽ‰

get_app_dir creates directories despite the documentation saying otherwise

The documentation for get_app_dir claims that it "[r]eturns (but does not create)" the path. However, its implementation calls get_root which does in fact create the path anyway. The other getters have similar problematic code.

This will create unexpected stray directories and/or fail when $HOME is not actually set to the user's home directory, such as when the environment has been cleared with env -i.

Support Android

I think trying to use this on Android would activate the unix branch and try to use the XDG spec... which I'm pretty sure that Android doesn't follow. ๐Ÿ˜ฑ

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.