views:

45

answers:

1

Is it possible to tell Ruby in Windows to use only \n instead of r\n? I'm having an issue where a file is being saved with \r\n and it is causing it to not function properly. Is there a setting somewhere I can change to fix this?

+1  A: 

The simple attack:

File.open("foo.txt", "w") do |fd|
    fd.write "this\nis\a\test\n"
end

And when I open this in hexedit:

00000000   74 68 69 73  0A 69 73 0A  61 0A 74 65  73 74 0A
                        ^^       ^^     ^^              ^^
                        \n       \n     \n              \n
yeah, after looking into this more I noticed this only happens with FileUtils.mvNew question http://stackoverflow.com/questions/2725680/fileutils-mv-adding-linebreaks-in-windows
Lowgain