Re: Simple I/O Problem
- Posted by Icy_Viking May 15, 2016
- 1338 views
Thanks, it worked. Although I had to change it to printf instead of print, otherwise it printed out {100,110,1010,1013} Or something along those lines. I'll post the code to help others.
include get.e atom handle object line handle = open("myfile.txt","w") if handle = -1 then puts(1,"Could not create file!") else printf(handle,"hello") end if close(handle) handle = open("myfile.txt","r") if handle = -1 then puts(1,"Could not open file!") else line = gets(handle) puts(1,line) end if