gfilepool

package
v0.0.0-...-3631402 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

文件指针池

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	*os.File // 底层文件指针
	// contains filtered or unexported fields
}

文件指针池指针

func OpenWithPool

func OpenWithPool(path string, flag int, perm os.FileMode, expire int) (*File, error)

获得文件对象,并自动创建指针池

func (*File) Close

func (f *File) Close()

获得底层文件指针

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

文件指针池

func New

func New(path string, flag int, perm os.FileMode, expire int) *Pool

创建一个文件指针池,expire = 0表示不过期,expire < 0表示使用完立即回收,expire > 0表示超时回收

func (*Pool) Close

func (p *Pool) Close()

关闭指针池

func (*Pool) File

func (p *Pool) File() (*File, error)

获得一个文件打开指针

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL