2020
12-22
12-22
golang文件读取-按指定BUFF大小读取方式
a.txt文件内容:ABCDEFGHIHELLOGOLANGpackagemainimport("fmt""os""io")funcmain(){fileName:="C:\\Robert\\日志分析\\tools_go\\vdn_sqlInterface\\a.txt"file,err:=os.OpenFile(fileName,os.O_RDWR,0666)iferr!=nil{fmt.Println("Openfileerror!",err)return}deferfile.Close()stat,err:=file.Stat()iferr!=nil{panic(err)}varsize=stat.Size()fmt.Println...
继续阅读 >