Documentation ¶
Index ¶
- func IsDir(path string) (bool, error)
- func LineCount(filePath string) int
- func PathExist(path string) (bool, error)
- func Paths(dir string) []string
- func ReadBlockHook(filePath string, bufferSize int, hook func(data []byte)) error
- func ReadOnce(filePath string) ([]byte, error)
- func WriterFile(filePath string, content []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadBlockHook ¶
ReadBlockHook 分块读取文件
- 将filePath路径对应的文件数据并将读到的每一部分传入hook函数中,当过程中如果产生错误则会返回error。
- 分块读取可以在读取速度和内存消耗之间有一个很好的平衡。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.