How To Read Mac Format Text Files
Posted: Tue Mar 29, 2005 3:14 pm
The PureBasic file read command ReadString() supports Unix (0x0a <LF> end of line) and DOS (0x0d0x0a <CR><LF> end of line) file formats.
Mac-format text files use 0x0d <CR> as the line terminator. When I try to read a Mac file line-by-line in a loop, Eof() never becomes #True, so I can't tell when the end of file has been reached. Can anyone suggest a simple way to read Mac-format files? I guess I could read the entire file into memory and replace all the <CR> characters with <LF>, but I was hoping for something easier, if possible.
Thanks,
Eric
Mac-format text files use 0x0d <CR> as the line terminator. When I try to read a Mac file line-by-line in a loop, Eof() never becomes #True, so I can't tell when the end of file has been reached. Can anyone suggest a simple way to read Mac-format files? I guess I could read the entire file into memory and replace all the <CR> characters with <LF>, but I was hoping for something easier, if possible.
Thanks,
Eric