摘要: package mainimport ( "net/http" "os" "io" "strconv")func main() { f, err := os.OpenFile("K:/file.mp3", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) stat, err := f.Stat() //获取文件状态 if err != nil { panic(err) } //把文件指针指到文件末,当然你说为何不直接用 O_APPEND 模式打开,没错是可以。我这 阅读全文
posted @ 2014-02-10 13:40 ggaaooppeenngg 阅读(4822) 评论(0) 推荐(0) 编辑
摘要: const ( O_RDONLY int = syscall.O_RDONLY // open the file read-only. O_WRONLY int = syscall.O_WRONLY // open the file write-only. O_RDWR int = syscall.O_RDWR // open the file read-write. O_APPEND int = syscall.O_APPEND // append data to the file when writing. O_... 阅读全文
posted @ 2014-02-10 12:30 ggaaooppeenngg 阅读(1324) 评论(0) 推荐(0) 编辑