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

Consider making TemporaryDirectory public? #23

Closed
alexito4 opened this issue Jan 31, 2019 · 3 comments
Closed

Consider making TemporaryDirectory public? #23

alexito4 opened this issue Jan 31, 2019 · 3 comments

Comments

@alexito4
Copy link

Hi,

I was checking out swiftsh code and found Path.mktemp which is really useful, but when trying to use it I was surprised is not available in Path. I see that in this library is just used as an helper for the tests but swiftsh uses it for production code in eject.

Would you consider making TemporaryDirectory part of the Path API? Or is there any reason why that's a bad idea?

Cheers

@mxcl
Copy link
Owner

mxcl commented Jan 31, 2019

Hi, TemporaryDirectory was public, but I removed it: cd30e8.

I did this because I didn't consider it within the responsibility boundary of this library. An entire library could be dedicated to temporary directories (and files) and thus would have better API and a more thorough implementation.

A good example of a better implementation is SwiftPM’s Utility library. Not that I think anyone should use that, but it's better for this particular area.

Thanks.

@alexito4
Copy link
Author

That makes sense thanks 👍

For SwiftPM, you refer to this file? TemporaryFile.swift

we can close this then 😉

Cheers

@mxcl
Copy link
Owner

mxcl commented Jan 31, 2019

Yeah that one. You can import it if you depend on the whole of SwiftPM, but that's why I say I wouldn't recommend it since it imports a lot of other stuff, and Apple themselves say you shouldn't depend on libUtility.

Thanks for the report, I consider this an area I may in future make a separate library for, in the mean time feel free to vendor the file!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants