file

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

func (*File) Close

func (f *File) Close() error

Close 关闭文件

func (*File) Read

func (f *File) Read(size int) (string, error)

Read 从文件中读取指定长度的内容 * size 长度 Read return 读取的内容,字符串格式

func (*File) ReadAll

func (f *File) ReadAll() (string, error)

ReadAll 从文件中读取全部内容 ReadAll return 读取的内容,字符串格式

func (*File) ReadAllBytes

func (f *File) ReadAllBytes() ([]byte, error)

ReadAllBytes 从二进制文件中读取全部内容 ReadAllBytes return 读取的内容,二进制格式

func (*File) ReadBytes

func (f *File) ReadBytes(size int) ([]byte, error)

ReadBytes 从二进制文件中读取指定长度的内容 ReadBytes return 读取的内容,二进制格式

func (*File) ReadLines

func (f *File) ReadLines() ([]string, error)

ReadLines 逐行文件中读取全部内容 ReadLines return 读取的内容,字符串数组格式

func (*File) Seek

func (f *File) Seek(offset int64) error

Seek 将文件指针移动到指定位置(从文件开头计算)

func (*File) SeekEnd

func (f *File) SeekEnd() error

SeekEnd 将文件指针移动到末尾

func (*File) SeekStart

func (f *File) SeekStart() error

SeekStart 将文件指针移动到开头

func (*File) Write

func (f *File) Write(content string) (int, error)

Write 写入字符串 Write return 写入的长度

func (*File) WriteBytes

func (f *File) WriteBytes(content []byte) (int, error)

WriteBytes 写入二进制 WriteBytes return 写入的长度

type FileInfo

type FileInfo struct {
	Name  string
	Mtime int64
	IsDir bool
	Size  int64
}

Jump to

Keyboard shortcuts

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