Documentation
¶
Overview ¶
Package tmp provides methods and structs for working with temporary data
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDirPerms = os.FileMode(0750)
DefaultDirPerms is default permissions for directories
View Source
var DefaultFilePerms = os.FileMode(0640)
DefaultFilePerms is default permissions for files
View Source
var Dir = "/tmp"
Dir is default temporary directory
Functions ¶
This section is empty.
Types ¶
type Temp ¶
type Temp struct { Dir string DirPerms os.FileMode FilePerms os.FileMode // contains filtered or unexported fields }
Temp is basic temp struct
func NewTemp ¶
NewTemp creates new Temp structure
Example ¶
tmp, _ := NewTemp() fmt.Println(tmp.Dir)
Output: /tmp
func (*Temp) Clean ¶
func (t *Temp) Clean()
Clean removes all temporary targets
Example ¶
tmp, _ := NewTemp() tmp.MkDir() // All temporary data will be removed tmp.Clean()
Output:
func (*Temp) MkDir ¶
MkDir makes temporary directory
Example ¶
tmp, _ := NewTemp() fmt.Println(tmp.MkDir()) fmt.Println(tmp.MkDir("test123")) tmp.Clean()
Output:
Click to show internal directories.
Click to hide internal directories.