Closed aligator closed 3 years ago
Hi @aligator, I think keeping the existing method of tmp folder allocation is a better decision then using the Golang build-in one. Here are twp points that I think are important.
ioutil.TempFile
method in ArozOS on those SBC before and this was what I concluded as the best approach to buffer a large file in these type of embedded systems)In summary, I will be suggesting that we can keep this part first and in future updates, we can allow user to define their own tmp folder location if needed. Do you think this will be a better approach?
Ah ok, I see. The only thing I can think of would be to just use the ioutil.TempFile in the standalone mode only. But yes, for now it's ok. Maybe we just leave this ticket open until we know how to handle it better?
I have added the custom flags for allowing user defined tmp folder.
To use it, start SlicerA with the -tmp
flag. Here is an example,
./SlicerA -tmp "/tmp"
Then all tmp files will be buffered to the system /tmp folder (which is the same as the place where ioutil buffers its temp files). Or otherwise, leave it as default for generating as the SlicerA's root folder.
I guess this is good enough for now. Let me know if you have other thought and I will re-open the issue if needed. Thanks!
Hi,
as I am not sure what you think about it I wanted to discuss this before creating a PR:
I would suggest to use
ioutil.TempFile
https://gobyexample.com/temporary-files-and-directories as it's the preferred way to create tmp files in Go.What do you think?