mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 05:07:44 +08:00
22 lines
423 B
Go
22 lines
423 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/os/gfile"
|
|
)
|
|
|
|
func main() {
|
|
path := "/tmp/temp"
|
|
content := `123
|
|
456
|
|
789
|
|
`
|
|
gfile.PutContents(path, content)
|
|
fmt.Println(gfile.Size(path))
|
|
fmt.Println(gfile.GetBytesTilCharByPath(path, '\n', 0))
|
|
fmt.Println(gfile.GetBytesTilCharByPath(path, '\n', 3))
|
|
fmt.Println(gfile.GetBytesTilCharByPath(path, '\n', 8))
|
|
fmt.Println(gfile.GetBytesTilCharByPath(path, '\n', 12))
|
|
}
|