posted 17 years ago
Where do you see those little boxes? When you open the file in Notepad or in another text editor?
Different operating systems use different sequences of bytes to represent newlines. On Unix, usually one character is used (LF = linefeed = ASCII code 10). On Windows, CR LF (carriage return + linefeed, ASCII codes 13 and 10) are used.
If you write a file with line separators that are different from what the native OS uses, or from what your text editor expects, you might see those boxes.
Use File.separator instead of "\n" to make sure that you're using the end-of-line character sequence of the platform that your program is running on.