The mode of permission is the last argument for os.OpenFile () and is a numeric value referring to the mode the os.OpenFile () will execute with. OCREATE: It creates a file if none exists. I wrote this code in 2016 but re-shared it for newbies.Ĭreate an Empty File package main import ( "log" "os" ) var ( newFile *os.File err error ) func main() fmt.Printf("Data as hex: %x\n", data) fmt.Printf("Data as string: &s\n", data) fmt. OAPPEND :It appends data to the file when writing.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |