From: paul.rogers@... (Paul) Date: 2004-03-17T09:39:33+09:00 Subject: Re: ruby 1.8.1/cygwin: Writing text files (dos mode) broken? PeJaMa@web.de (Marcus Heyking) wrote in message news:<2b3b40bb.0403160853.639303b7@posting.google.com>... > I was recently running some tests before switching to ruby 1.8.1 on cygwin. I > found one problem that currently keeps me from installing ruby 1.8.1: > > When writing text files they end up as unix files even though I explicitly > told setup.exe to use dos mode: > > f = File.new("test.txt","w") > f.puts("Where \n is the CR?") > f.close > > Running above script on ruby 1.8.1 will create test.txt with only 0x0a (LF) > as line delimiter. When using ruby 1.6.8 this correctly creates a dos-like > text file (CR+LF) > > My ruby app (a build engine) creates c/cpp headers and resource files to be > used by cl.exe and friends - and some of them won't accept unix style files. > > Maybe someone could verify/comment on that? Did I miss something here? IMHO > line ending conversion should still be transparent to ruby scripts? > > ps. Actually I think this is caused by io.c:line 4087 where cygwin_internal() > is used to unconditionally set file IO to binmode!? when installing cygwin you get the option to select the file type - unix or msdos - could you have set this and now ruby is correctly creating unix style files?