Working with the `/tmp` directory

Back to index
Date: 2021-07-12
Category: go


All files within the /tmp directory require the sticky bit to be set.

When creating a directory, this can be achieved as follows:

tempDir := getTemporaryDir()
_ = os.Mkdir(tempDir, os.ModeDir|os.ModeSticky|os.FileMode(0700))