func (f *Filer) OpenFile(name string, flag int, perm os.FileMode) (*File, error) {
	file, err := f.openFile(name, flag, perm)
	if file != nil {
		file.pcN = runtime.Callers(0, file.pc[:])
	}
	return file, err
}
OpenFile is a generalized file open method.

It is similar to os.OpenFile except it will block if Filer has exhasted
its file descriptors until one is available.
package iox
import (
	"context"
	"os"
	"path/filepath"
	"runtime"
	"strconv"
	"sync"
	"syscall"
	"time"
)
type Filer struct {
	DefaultBufferMemSize int  
	Logf func(format string, v ...interface{})  
	tempdir string
	shuttingDown chan struct{}  
	mu      sync.Mutex
	cond    *sync.Cond
	files   map[*File]struct{}
	fdlimit int
	seed    uint32
}
func NewFiler(fdLimit int) *Filer {
	if fdLimit == 0 {
		var lim syscall.Rlimit
		syscall.Getrlimit(syscall.RLIMIT_NOFILE, &lim)
		fdLimit = int(lim.Max - (lim.Max / 10))
	}
	if fdLimit == 0 {
		fdLimit = 90  
	}
	filer := &Filer{
		DefaultBufferMemSize: 1 << 16,
		tempdir:      os.TempDir(),
		shuttingDown: make(chan struct{}),
		files:        make(map[*File]struct{}),
		fdlimit:      fdLimit,
	}
	filer.cond = sync.NewCond(&filer.mu)
	return filer
}
func (f *Filer) SetTempdir(tempdir string) {
	f.tempdir = tempdir
}
func (f *Filer) Open(name string) (*File, error) {
	file, err := f.openFile(name, os.O_RDONLY, 0)
	if file != nil {
		file.pcN = runtime.Callers(0, file.pc[:])
	}
	return file, err
}