From: Christian C. <chc...@cl...> - 2001-08-12 07:56:30
|
Eric Bezault wrote: > > Considering that 'eol' is "%R%N" under Windows, I don't think > that this will work with what some of the Eiffel compilers > currently provide us since it is likely that you will end > up with: > > Hello world!%R%R%N > > in your file, the %N (second character in 'eol') being > automatically converted to %R%N. I don't use Windows any more so I cannot easily test. But perhaps you are right, perhaps some compiler blindly convert all %N to %R%N without checking if there is already a %R before. It would be strange anyway because what would happen if you read a whole text file into a string and then just write the string back to another file ? Would the "%R%N" be converted to a "%N" when reading the file and then to "%R%N" again when writing the file ? Could someone test ? If what you say is true, perhaps it could still be possible to define the meaning of "eof" depending both on the target platform and the compiler. So that for example eof would always be "%N" if SmallEiffel is used, and it would be "%N" on Unix or "%R%N" on Windows if another compiler is used. Regards, Christian. |