Conversation
hulto
left a comment
There was a problem hiding this comment.
Oops sorry @adm1nPanda i should have been more clear in the issue description.
For this feature we'd like to leverage the OSes default tmp system.
/tmp/ on linux, /var/private/tmp/*/*/* on mac, C:\Users\AppData\Local\Temp (i think) on Windows. You shouldn't need to specify the tmp dir path the library should handle that for you.
To do this we can leverage the temp file library we've been using and it looks like the .keep() call you're making is exactly what we need.
Instead of a random file name in a specified dir i'd like to create a tmp file in and optionally specify the name of that file.
The file should be empty and the function should return the path to the newly created file.
hulto
left a comment
There was a problem hiding this comment.
Awesome! Just a couple changes then should be good 🤌
hulto
left a comment
There was a problem hiding this comment.
Clarified how to do optional parameters.
This way lets users do something like:
tmp_file = file.temp()
# - or -
name_tmp_file = file.temp("special_name.txt")
hulto
left a comment
There was a problem hiding this comment.
Couple nits that you can ignore if you want.
One small change please.
hulto
left a comment
There was a problem hiding this comment.
Nice!
Some optional nits if you want but this looks good to me! 🙂
What type of PR is this?
/feature
/kind eldritch-function
What this PR does / why we need it:
Implemented file.temp_file()
Which issue(s) this PR fixes:
Fixes #788