From: Shashank Date Date: 2005-06-24T06:31:29+09:00 Subject: Re: reading binary from STDIN in windows Try this: ruby -e 'STDIN.binmode;i=STDIN.read; open("test.pdf","wb").write(i)' < some.pdf Notice how binmode sets the binary mode. -- shanko --- Wybo Dekker wrote: > Windows again -( > How can I read a binary file from STDIN? > > For example, in linux I can copy some.pdf to > test.pdf: > > ruby -e 'i=STDIN.read; > open("test.pdf","w").write(i)' > in windows I can (and must) use "wb" instead of "w", > but how do I specify > STDIN to be binary? > > (I need this for a filter working on pdf-files) > > -- > Wybo > > ____________________________________________________ Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football http://football.fantasysports.yahoo.com