Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rootDirectory option #35

Open
sindresorhus opened this issue Apr 20, 2021 · 7 comments
Open

Add rootDirectory option #35

sindresorhus opened this issue Apr 20, 2021 · 7 comments

Comments

@sindresorhus
Copy link
Owner

sindresorhus commented Apr 20, 2021

As requested in #33.

I guess it could be useful for when you want to semantically group all the temp directory usage in one directory for easier manual cleanup. This is not really useful for the .task methods though as they clean up themselves.

I'm not entirely sold on this though, as every option adds complexity for the user and most users will not need this. I'm also concerned users will think they need this when most often, they don't.

@Richienb
Copy link
Contributor

Richienb commented Apr 17, 2022

Earlier @aminya stated that they want to be able to manually clear temporary objects created by tempyFile and tempyDirectory at their discretion with a single command and that putting everything in a single folder would make it really easy.
#33 (comment)

@ludicast
Copy link

ludicast commented May 3, 2024

I respect keeping the surface area small, but I'm pretty surprised that you are skeptical re its value. Many people who need or have cases for this might not want to comment publicly on why (private projects, NDAs, non-confrontational temperaments, etc). Added to which software is going to be used in contexts the creator doesn't anticipate.

An example that comes to mind immediately (not my case) is that a different filesystem might be needed for these temporary files (e.g. /tmp, /home, and /var are sometimes mounted from different "drives"). Or somebody might want to use a journaling filesystem or something similar for reasons. Yes there are easy workarounds (I'm guessing making /private/var/folders/ a symlink to the intended directory structure does the trick), but they push knowledge of your tool's internals to an unrelated part of somebody's codebase.

I imagine most just use something else that gives them more filesystem control (even if by a less trusted name in software ™️). So you're not hearing about this from them because they just go someplace else 😸 .

But obv your lib & call o/c. Just my 2 cents that is parameterizing the directory seems on the surface to provide value at minimal maintenance cost (plus I think there was already a 10-line PR someone did for this).

@Richienb

This comment was marked as off-topic.

@aminya

This comment was marked as off-topic.

@sindresorhus
Copy link
Owner Author

#46 would solve the use-case of grouping.

@sindresorhus
Copy link
Owner Author

I'm still willing to add an option called rootDirectory for niche use-cases, but the parentDirectory option should be recommended instead in the docs.

@sindresorhus

This comment was marked as off-topic.

@sindresorhus sindresorhus changed the title Add root directory option Add rootDirectory option Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants