how to read all of STDIN?

375 views
Skip to first unread message

Roger Pack

unread,
Jun 19, 2018, 11:04:25 AM6/19/18
to Crystal
I'm wanting to do something like this from Ruby:

puts STDIN.read


Is there any way to do that in crystal?


Similar to https://stackoverflow.com/questions/45215658/read-whole-lines-from-stdin-without-pressing-enter-with-crystal-lang but I just want the whole thing not one line at a time.


Thanks.

Faustino Aguilar

unread,
Jun 19, 2018, 12:43:21 PM6/19/18
to Crystal

Roger Pack

unread,
Jun 19, 2018, 1:32:53 PM6/19/18
to crysta...@googlegroups.com


On Tue, Jun 19, 2018 at 10:43 AM Faustino Aguilar <faust...@gmail.com> wrote:

gets_to_end worked, thanks!
A bit confusing as it's different from Ruby but OK... :) 
--
You received this message because you are subscribed to a topic in the Google Groups "Crystal" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/crystal-lang/O4DExFHJc5E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to crystal-lang...@googlegroups.com.
To post to this group, send email to crysta...@googlegroups.com.
Visit this group at https://groups.google.com/group/crystal-lang.
To view this discussion on the web visit https://groups.google.com/d/msgid/crystal-lang/93ca3cfd-1c74-41c1-a36a-844f310d18ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages