func (t *Temp) MkFile(nameSuffix ...string) (*os.File, string, error) {
	if t == nil {
		return nil, "", fmt.Errorf("Temp struct is nil")
	}
	name := ""
	if len(nameSuffix) != 0 {
		name = nameSuffix[0]
	}
	tmpFile := getTempName(t.Dir, name)
	fd, err := os.OpenFile(tmpFile, os.O_RDWR|os.O_CREATE, t.FilePerms)
	if err != nil {
		return nil, "", err
	}
	t.targets = append(t.targets, tmpFile)
	return fd, tmpFile, nil
}
MkFile makes temporary file
package tmp
import (
	"fmt"
	"os"
	"path"
	"pkg.re/essentialkaos/ek.v12/fsutil"
	"pkg.re/essentialkaos/ek.v12/rand"
)
type Temp struct {
	Dir       string
	DirPerms  os.FileMode
	FilePerms os.FileMode
	targets []string
}
var Dir = "/tmp"
var DefaultDirPerms = os.FileMode(0750)
var DefaultFilePerms = os.FileMode(0640)
func NewTemp(dir ...string) (*Temp, error) {
	tempDir := path.Clean(Dir)
	if len(dir) != 0 {
		tempDir = path.Clean(dir[0])
	}
	if !fsutil.IsExist(tempDir) {
		return nil, fmt.Errorf("Directory %s does not exist", tempDir)
	}
	if !fsutil.IsDir(tempDir) {
		return nil, fmt.Errorf("%s is not a directory", tempDir)
	}
	if !fsutil.IsWritable(tempDir) {
		return nil, fmt.Errorf("Directory %s is not writable", tempDir)
	}
	return &Temp{
		Dir:       tempDir,
		DirPerms:  DefaultDirPerms,
		FilePerms: DefaultFilePerms,
	}, nil
}
func (t *Temp) MkDir(nameSuffix ...string) (string, error) {
	if t == nil {
		return "", fmt.Errorf("Temp struct is nil")
	}
	name := ""
	if len(nameSuffix) != 0 {
		name = nameSuffix[0]
	}
	tmpDir := getTempName(t.Dir, name)
	err := os.MkdirAll(tmpDir, t.DirPerms)
	if err != nil {
		return "", err
	}
	t.targets = append(t.targets, tmpDir)
	return tmpDir, err
}