func NewMFile(fname string, flag int, perm os.FileMode, delta_ns int64) (m *MFile, err error) {
	m = &MFile{}
	m.t0 = time.Now().UnixNano()
	if m.file, err = os.OpenFile(fname, flag, perm); err != nil {
		return
	}
	var fi os.FileInfo
	if fi, err = m.file.Stat(); err != nil {
		return
	}
	m.ctime = fi.ModTime().UnixNano()
	m.delta = delta_ns
	runtime.SetFinalizer(m, func(m *MFile) {
		m.file.Close()
	})
	return
}
NewMFile returns a newly created MFile or Error if any.
The fname, flag and perm parameters have the same meaning as in os.Open.
For meaning of the delta_ns parameter please see the (m *MFile) File() docs.
package fileutil
import (
	"fmt"
	"io"
	"os"
	"path/filepath"
	"runtime"
	"strconv"
	"sync"
	"time"
)
type GoMFile struct {
	mfile *MFile
	mutex sync.Mutex
}
func NewGoMFile(fname string, flag int, perm os.FileMode, delta_ns int64) (m *GoMFile, err error) {
	m = &GoMFile{}
	if m.mfile, err = NewMFile(fname, flag, perm, delta_ns); err != nil {
		m = nil
	}
	return
}
func (m *GoMFile) File() (file *os.File, err error) {
	m.mutex.Lock()
	defer m.mutex.Unlock()
	return m.mfile.File()
}
func (m *GoMFile) SetChanged() {
	m.mutex.Lock()
	defer m.mutex.Unlock()
	m.mfile.SetChanged()
}
func (m *GoMFile) SetHandler(h MFileHandler) {
	m.mutex.Lock()
	defer m.mutex.Unlock()
	m.mfile.SetHandler(h)
}
type MFileHandler func(*os.File) error
type MFile struct {
	file    *os.File
	handler MFileHandler
	t0      int64
	delta   int64
	ctime   int64
}