AutoCloseable or self-disposing temp files #140
mpollmeier
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
I like the We could also add some convenience methods |
Beta Was this translation helpful? Give feedback.
1 reply
-
here's a first attempt: #147 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For temp files/dirs we currently rely on the JVM's
deleteOnExit
shutdown handler to remove them. That's not ideal though for a number of reasons, including:There's a variety of ways we could handle this better - two that come to mind immediately are
AutoCloseable
, e.g. onPath
or add a new typeTempPath
that does it. That way users can rely on things likescala.util.Using
.using
abstraction, similar to what better-files does - see https://github.com/pathikrit/better-files#temporary-filesAny thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions