Re: [go-nuts] Best practice when creating temporary files

2016-11-18 Thread Tamás Gulácsi
2016. november 18., péntek 12:21:48 UTC+1 időpontban Jan Mercl a következőt írta: > > On Fri, Nov 18, 2016 at 11:21 AM Ondrej > > wrote: > > Not sure if it's correct, just an idea (error handling elided): > > func main() { > ... > exec.Cmd(browser, pathNa

Re: [go-nuts] Best practice when creating temporary files

2016-11-18 Thread Jan Mercl
On Fri, Nov 18, 2016 at 11:21 AM Ondrej wrote: Not sure if it's correct, just an idea (error handling elided): func main() { ... exec.Cmd(browser, pathName).Start() syscal.Unlink(pathName) } The temp file in pathName will be delete

[go-nuts] Best practice when creating temporary files

2016-11-18 Thread Ondrej
I have a tool that generates some HTML and launches a web browser to display it. For this to work, I need to save the HTML some place and I also need to handle the file afterwards. The app itself doesn't persist - it generates the content and exits. There are thus two issues I'm struggling with