Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
reading binary from STDIN in windows
Wybo Dekker
6/23/2005 8:10:00 PM
2 Answers
Shashank Date
6/23/2005 9:31:00 PM
0
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 <wybo@servalys.nl> 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)' <some.pdf
>
> 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...
Wybo Dekker
6/24/2005 6:58:00 AM
0
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
reading binary from STDIN in windows
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password