[Scummvm-devel] File handling revamp

Max Horn max at quendi.de
Fri Aug 1 12:58:40 CEST 2008


Am Fr, 1.08.2008, 12:14, schrieb Torbjörn Andersson:
> One thing that was mentioned on #scummvm yesterday, which I don't think
> has come up in this discussion yet (I've been out of town for a few
> days, and haven't read it as carefully as I should), is that the
> configuration file is apparently written with Unix line breaks, even
> under Windows. They're created by
>
>     stream.writeByte('\n');
>
> so they're always written as one byte. (I haven't actually verified this
> myself, since I don't run ScummVM under Windows.)
>
> The readLine() function should already handle anything that looks even
> remotely like a line break (which is good, because we want to be able to
> read any old text file), but I guess it would be a good idea to write
> text files in the native format. (Or is there any case where we want to
> write non-native line breaks?)
>

Fine by me. So, how do we determine what native line breaks are?
 #if WINDOWS
   stream.writeByte('\r');
 #else
   stream.writeByte('\n');
 #endif

?

Bye,
Max




More information about the Scummvm-devel mailing list