whitequark / rust-xdg

A library that makes it easy to follow the X Desktop Group specifications
https://wiki.freedesktop.org/www/Specifications/
Apache License 2.0
146 stars 29 forks source link

Add get_trash_dir function (#1) #23

Closed cjbassi closed 4 years ago

whitequark commented 5 years ago

Can you add a link to the specification that describes this functionality?

whitequark commented 5 years ago

OK, so there are a few issues with this PR.

  1. You're expanding the BaseDirectories struct. However, the Trash directory is not a part of Base Directories spec; it's in its own specification.
  2. Your implementation is very incomplete. The Trash specification implies that the trash directory is, ideally, not just a single directory, but a directory whose location depends on the file being deleted. Further, even in case of a home trash directory, it should be automatically created, which this implementation does not provide.
cjbassi commented 5 years ago

Thanks for the feedback. I'll read up more on the spec (should've done this already) and make sure to implement this correctly, assuming that you do want this added.

whitequark commented 5 years ago

Seems like a useful addition!

cjbassi commented 4 years ago

Closing due to housekeeping and since this doesn't provide much of an implementation. Also, I'm personally in need of a cross platform crate for trash functionality so if I do get the time to implement that, it would probably be its own crate.