You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs does not exist, or lacks the specified key (e.g. XDG_DOWNLOAD_DIR), the behaviour of xdg-user-dir the CLI program is to output $HOME.
In the same case, the behaviour of dirs::download_dir() (for example) is to return None.
There's no specification as such for '"well known" user directories', but it's implied that this is the intended fall-back behaviour:
Note: To disable a directory, point it to the homedir.
I don't read this sentence of the spec as a fallback behavior, but as a way to disable a directory ("To disable a directory, point it to the homedir.") as they seemingly have used "no entry" for other purposes already.
I believe this is correctly represented with None in Rust. Feel free to reopen if you have further thoughts on this!
I suppose it depends whether you view the API as 'what has been configured?' (nothing, None) or 'what is the directory to use?' (not configured, $HOME or something sensible).
It'd be nice if these various libraries/tools were consistent on the matter, but having lost context on this I think you're right, it's at best ambiguous, and absent something explicit they never will be.
If
${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs
does not exist, or lacks the specified key (e.g.XDG_DOWNLOAD_DIR
), the behaviour ofxdg-user-dir
the CLI program is to output$HOME
.In the same case, the behaviour of
dirs::download_dir()
(for example) is to returnNone
.There's no specification as such for '"well known" user directories', but it's implied that this is the intended fall-back behaviour:
https://www.freedesktop.org/wiki/Software/xdg-user-dirs/
cf. tauri-apps/tauri#3090, xdg-rs/dirs#56 (I opened there as that's what I'm using, via tauri, but it seems to affect
dirs
too, so I've copied here.)The text was updated successfully, but these errors were encountered: