I am manually creating a temporary file using:
tempDir := os.TempDir()
tempFile := filepath.Join(tempDir, "my.file")
ioutil.WriteFile(tempFile, []byte{}, os.ModeTemporary)
I am intentionally avoiding ioutil.TempFile()
because I don't want a random suffix to be appended to the filename.
When browsing through the different types of permissions in the os
package, ModeTemporary
seemed the most fitting but is also commented with:
ModeTemporary // T: temporary file; Plan 9 only
What's Plan 9 and why does only it support ModeTemporary
?
Can I use ModeTemporary
on normal Linux distributions as well?