apeiros changed the topic of #ruby-lang to: Nick registration required to talk || Ruby 2.0.0-p195: http://ruby-lang.org (Ruby 1.9.3-p429) || Paste >3 lines of text on http://gist.github.com
swav has quit [Remote host closed the connection]
cirenyc has quit [Quit: Leaving...]
<eam>
does ruby (specifically ffi) have anything that'll read a C header file and generate FFI::Struct classes for each typedef?
justinmburrous has quit [Ping timeout: 264 seconds]
<eam>
similar to perl's h2xs is what I'm after
<matti>
eam: I haven't seen one.
<mistym>
eam: Do you need it to happen at runtime?
<eam>
nope, not runtime -- I want to translate the kerberos headers into structs and there are just too many to do by hand
marr has quit [Ping timeout: 246 seconds]
<mistym>
Use swig and ffi-gen, then.
<zenspider>
there was one in ruby 1.8 in ext/dl/h2rb
rsync has joined #ruby-lang
<zenspider>
it might at least get you started
<mistym>
swig has builtin ruby support, but I think only for C extensions. ffi-swig-generator has a commandline tool which can take swig's XML output and turn that into ffi classes
<rsync>
Good Morning
<zenspider>
MY FAVORITE TOOL!
<eam>
ah grat thanks both
<eam>
*great
<eam>
I happen to be on 1.8 unfortunately
<zenspider>
nothing unfortunate about it... now you can use the tool
ehutzelman has quit [Remote host closed the connection]
cofin has joined #ruby-lang
<zenspider>
tho I think you need a source checkout... it doesn't look like it would be installed
runeb has joined #ruby-lang
<eam>
nabbed it -- looks like it wants to write to /usr/include, sigh -- but this is a good start :)
runeb has quit [Ping timeout: 261 seconds]
tylersmith has joined #ruby-lang
<eam>
oooh, very close. I think I can work with this. It biffed a few corner cases where C's integer types differ from ruby, eg 0x7fffffff vs 0x7fffffffL
tylersmi_ has joined #ruby-lang
jonahR has quit [Ping timeout: 240 seconds]
<eam>
but only 7 or so syntax errors out of a 3.5k line transform
tylersmith has quit [Ping timeout: 256 seconds]
<zenspider>
eam: nice
jonahR has joined #ruby-lang
cofin has quit [Quit: cofin]
Junkyardhands has joined #ruby-lang
cofin has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
arubin has joined #ruby-lang
Junkyardhands has quit [Remote host closed the connection]
hogeo has joined #ruby-lang
tylersmi_ has quit [Ping timeout: 264 seconds]
tkuchiki has joined #ruby-lang
justinmburrous has joined #ruby-lang
kstuart has quit [Ping timeout: 260 seconds]
justinmburrous has quit [Remote host closed the connection]
cofin has quit [Quit: cofin]
vlad_starkov has joined #ruby-lang
brianpWins has joined #ruby-lang
gregmoreno has quit [Ping timeout: 252 seconds]
<eam>
what does #$ do in a string?
<manveru>
same as #$foo is same as #{$foo}
<manveru>
-same as
<eam>
aah
<manveru>
also for #@foo
<manveru>
and #@@foo
<perry>
what's the best pcap gem? I tried out pcaprub because it had the most downloads on rubygems.org, but found out that it didn't do packet processing.
<eam>
found it while trying to build a character set in a regex, [a-z.!@#$]+ blew up
<manveru>
yeah, use Regexp.escape i think
<manveru>
hm, no
<manveru>
not for char groups
<eam>
I'm just going to keep # away from $ and @ I guess =/
<jroes>
whoa, #$ does string interpolation? how come no one uses it?
<jroes>
I almost never see anyone use that syntax
<eam>
jroes: #$ for $globals only
<manveru>
almost nobody uses globals
<manveru>
i use #@ sometimes
<jroes>
oh, whoops
<eam>
that's a neat trick
vlad_starkov has quit [Ping timeout: 268 seconds]
<manveru>
but yeah... in a world where people use pass_a_string("#{"foo".to_s}")
ia___ has joined #ruby-lang
cored has quit [Ping timeout: 260 seconds]
pskosinski has quit [Quit: pskosinski]
teleological has joined #ruby-lang
rwk1 has joined #ruby-lang
wmoxam has quit [Ping timeout: 252 seconds]
dankest has quit [Quit: Leaving...]
bzalasky has joined #ruby-lang
nathanstitt has joined #ruby-lang
cirenyc has joined #ruby-lang
swav has joined #ruby-lang
runeb has joined #ruby-lang
runeb has quit [Remote host closed the connection]
<seydar>
are there any major discrepancies between 32bit and 64bit in the world of ruby?
teleological has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
fess has quit [Read error: Connection reset by peer]
rwk1 has joined #ruby-lang
chana has joined #ruby-lang
<athetius>
seydar I don't think so, minus more math power in 64bit
<seydar>
in this modern day and age, is there any reason i should hang back in the 32bit world?
vlad_starkov has quit [Remote host closed the connection]
<athetius>
Some programs (like SecondLife's client) are only avail in 32bit linux, there might be a few drivers also. That being said, I said nothing about ruby. Luckily you can always run 32bit in 64bit.
<pipework>
And just in that list alone, digital oceans' 512mb plan is the most popular, and with linode's upgrade to 1gb for the cheapest, it's more true.
smook2 has joined #ruby-lang
<pipework>
lolk.
cofin has quit [Quit: cofin]
gnufied1 has joined #ruby-lang
sush24_ has quit [Read error: Connection reset by peer]
<yorickpeterse>
Personally I'm happy with paying around 45 USD for a massively overkill Linode box since besides the hack thing Linode has been nothing but amazing
<yorickpeterse>
(note that said box has received various free upgrades, hence it's even more overpowered)
<yorickpeterse>
8 cores and 2GB of RAM for 1 static website, a simple Ruby website and an IRC bot
northelks has joined #ruby-lang
<yorickpeterse>
and ofc my IRC client, very important
<athetius>
yorickpeterse: I agree, I love my Linode
* brycek
cries into cat about the "lifetime" joyent box
wallerdev has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
nveselinov has quit [Read error: Connection reset by peer]
<cout>
is there a method already written somewhere that will parse the content-type header, e.g. Content-Type: foo/bar; charset=blah; action="foo:bar:baz:HiThere"
bzalasky has quit [Remote host closed the connection]
<cout>
I can write one myself buy I'm afraid I'll get the details wrong
nveselinov has joined #ruby-lang
teleological has quit [Remote host closed the connection]
machuga is now known as machuga|away
tylersmith has joined #ruby-lang
vlad_starkov has joined #ruby-lang
dhruvasagar has joined #ruby-lang
rwk1 has quit [Ping timeout: 246 seconds]
tylersmith has quit [Ping timeout: 252 seconds]
glebm has quit [Quit: Computer has gone to sleep.]
benlovell has quit [Ping timeout: 245 seconds]
artie has joined #ruby-lang
<cout>
so sad that this channel has died :(
DeFii has joined #ruby-lang
barttenbrinke has joined #ruby-lang
DeFii has left #ruby-lang [#ruby-lang]
anjen has joined #ruby-lang
artie has quit [Remote host closed the connection]
Defu has joined #ruby-lang
Defu has left #ruby-lang [#ruby-lang]
teleological has joined #ruby-lang
lguardiola_ has joined #ruby-lang
lguardiola_ has quit [Client Quit]
<yorickpeterse>
refactoring is the best
randallagordon has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
tbuehlmann has quit [Remote host closed the connection]
ikrima has quit [Quit: Computer has gone to sleep.]
rwk1 has quit [Ping timeout: 240 seconds]
barttenbrinke has joined #ruby-lang
glebm has joined #ruby-lang
foca_ has quit [Ping timeout: 245 seconds]
realDAB has joined #ruby-lang
duckinator has quit [Ping timeout: 252 seconds]
nick_h_ has quit [Ping timeout: 252 seconds]
henrikhodne has joined #ruby-lang
gregmoreno has joined #ruby-lang
tpope has quit [Ping timeout: 264 seconds]
cout has quit [Ping timeout: 276 seconds]
Aloysius1 has joined #ruby-lang
<Aloysius1>
G'day! If I have script A which I want to run as a demon from script B, is there a way to capture script A's stdout without changing script A? So, if A is "puts 'hello, world!'" is there a way that I can start that from B so that 'hello, world!' ends up in a file (without changing A at all)?
davemaurakis has joined #ruby-lang
saarinen has quit [Quit: saarinen]
crackity_jones has joined #ruby-lang
sharma__ has quit [Quit: Leaving]
sush24 has joined #ruby-lang
tpope has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
barttenbrinke has quit [Remote host closed the connection]
stringly_typed has joined #ruby-lang
gja has quit [Quit: This computer has gone to sleep]
pipework has quit [Remote host closed the connection]
pipework has joined #ruby-lang
crackity_jones has quit [Quit: Computer has gone to sleep.]
runeb has joined #ruby-lang
pipework has quit [Ping timeout: 276 seconds]
stringly_typed has joined #ruby-lang
runeb has quit [Remote host closed the connection]
hinbody has joined #ruby-lang
runeb has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
havenwood has joined #ruby-lang
machuga is now known as machuga|away
teleological has quit [Remote host closed the connection]
rwk1 has joined #ruby-lang
faramir has quit [Ping timeout: 240 seconds]
runeb has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
rwk1 has quit [Ping timeout: 276 seconds]
elia has joined #ruby-lang
joschi has quit [Remote host closed the connection]
ldnunes has quit [Quit: Leaving]
joschi has joined #ruby-lang
davemaurakis has quit [Remote host closed the connection]
<Aloysius1>
So, I'm looking at Dante and it seems to run inline code (as opposed to demonizing scripts, a la Daemons). So it can capture stdout becuse it's its own stdout.
cofin has joined #ruby-lang
brycek has left #ruby-lang [#ruby-lang]
wesside has quit [Quit: Computer has gone to sleep.]
stringly_typed has quit [Quit: Computer has gone to sleep.]
danrabinowitz has quit [Remote host closed the connection]
__butch__ has quit [Quit: Leaving.]
krames has joined #ruby-lang
chana has quit [Quit: chana]
<Aloysius1>
So it seems like I can use one of the "open"s if I don't need a daemon. Or a daemon if I don't need stdout. Not both.
danrabinowitz has joined #ruby-lang
chana has joined #ruby-lang
vlad_starkov has joined #ruby-lang
synthetix has quit [Ping timeout: 268 seconds]
stringly_typed has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
<wmoxam>
2
henrikhodne has quit [Quit: Computer has gone to sleep.]
jonahR has quit [Quit: jonahR]
<drbrain>
wmoxam: today's artisinal, shade-grown, hand-picked random number?
chana has quit [Quit: chana]
ezkl has joined #ruby-lang
thiagoborges has quit [Remote host closed the connection]
<wmoxam>
drbrain: organic too
<drbrain>
ooh
<wmoxam>
cage free
<wmoxam>
free run
Aaaarg has quit [Read error: Operation timed out]
Aaaarg has joined #ruby-lang
Todd has quit [Read error: Connection reset by peer]
verto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<manveru>
the only page i ever visit on geocities :)
<drbrain>
well, ruby 2 doesn't use oniguruma anymore (onigmo instead, a fork)
<eam>
oh my god
<eam>
ruby regex has multiline matching on by default?
<manveru>
yeah, the handling of encodings differs a bit afaik
<eam>
the /m operator is inverted from perl?
<eam>
is that what I'm running into?
wallerdev has joined #ruby-lang
malev has quit [Remote host closed the connection]
<heftig>
eam: the multiline modifier only seems to affect the behavior of .
<whitequark>
eam: no, it's not inverted
<whitequark>
what heftig says
<heftig>
in multiline mode, . matches \n
nathanstitt has quit [Quit: I growing sleepy]
<eam>
but multiline mode doesn't change anchor behavior at all?
<whitequark>
yes
<heftig>
nope
<heftig>
it doesn't
<whitequark>
eam: the anchor gotcha is actually a cause of a multitude of security bugs.
<whitequark>
unfortunately.
<eam>
whitequark: yeah I'm aware, ruby's break from the established syntax just created one
<eam>
for me
<eam>
because of this difference between PCRE and ruby RE
<eam>
=/
<eam>
in all other RE languages I'm aware of that support ^ and multiline match, ^ anchors on string start unless multiline is on
gnufied has joined #ruby-lang
Kabaka has quit [Remote host closed the connection]
smook2 has quit [Ping timeout: 255 seconds]
Kabaka has joined #ruby-lang
* zenspider
pops some popcorn and enjoys the trainwreck^Wshow
stringly_typed has quit [Quit: Computer has gone to sleep.]
<Aloysius1>
I can't find anything recent on this: If I'm reading an IO object (this is from a PTY.spawn call) is there a simple way to say "read-data unless there is no data to read"?
<zenspider>
you prolly want to use seleect
<zenspider>
select even
<cout>
zenspider: is that trainwreck <beginning-of-line> Wshow or trainwreck <beginning-of-string> Wshow ? :)
<eam>
haha
<zenspider>
cout: boo
<zenspider>
beginning-of-line, of course
<eam>
cout: if only ruby RE had a way to distinguish the two!
<zenspider>
uhh
<eam>
so from what I can tell, the symbol anchors in ruby ^$ are always in multiline mode
<eam>
and /m never modifies anchor behavior
<heftig>
(?<=\n)
chana has quit [Quit: chana]
<eam>
and I think I'm going to stick to PCRE in ruby from now on =/
<drbrain>
Aloysius1: or read_nonblock
<heftig>
Aloysius1: or readpartial
<drbrain>
I always forget about readpartial
<heftig>
ah, readpartial will block
gnufied has quit [Quit: Leaving.]
<heftig>
read_nonblock is what you want
<heftig>
the doc even has an example using select
justinmburrous has quit [Remote host closed the connection]
<drbrain>
rickhull: can you show a performance improvement by removing polyglot?
<rickhull>
whew, ok
<ged_>
I've been surprised by the exact same thing
<rickhull>
drbrain: doubtful
<rickhull>
i mean, i guess i could try
<rickhull>
it's more of principle for me
ged_ is now known as ged
<drbrain>
rickhull: this is why I've avoided gems depending on treetop
<rickhull>
for me, it's json_select
<drbrain>
it uses polyglot by default which adds behavior I'm afraid of
tomzx has joined #ruby-lang
saarinen has joined #ruby-lang
<zenspider>
yup yup
rwk1 has quit [Ping timeout: 245 seconds]
<rickhull>
in practice, i'm sure the behavior is ok. but it's a whole unnecessary layer of uncertainty
<ged>
Also: mail.
<ged>
(the gem)
x0f has quit [Ping timeout: 252 seconds]
krames has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wmoxam has joined #ruby-lang
intellitech has quit [Quit: SMOKE BOMB!]
kstuart has quit [Quit: kstuart]
<Aloysius1>
Thanks zenspider, drbrain and heftig. (Even if readpartial does block.)
mossplix has joined #ruby-lang
kstuart has joined #ruby-lang
mossplix has quit [Client Quit]
<Aloysius1>
Huh. Works for a while, then..."Uncaught exception: Resource temporarily unavailable - read would block"
mossplix has joined #ruby-lang
<drbrain>
you need to rescue and continue, the documentation on read_nonblock explains this
mbj has quit [Ping timeout: 240 seconds]
<heftig>
you need to rescue IO::WaitReadable
<Aloysius1>
drbrain: Yeah...thanks.
<Aloysius1>
Thanks, guys. Reading thoroughly now.
mistym has joined #ruby-lang
mistym has joined #ruby-lang
<rickhull>
IME, depending on what you're trying to do, you can end up down a rabbit hole of edge cases trying to avoid blocking reads
<rickhull>
basically end up with a massive amounts of state, when a different approach might be cleaner
ffio_ has joined #ruby-lang
stringly_typed has joined #ruby-lang
ffio has quit [Ping timeout: 245 seconds]
<rickhull>
Aloysius1: what is your objective at a high level?
DomKM has quit [Quit: Leaving.]
jbsan has joined #ruby-lang
<rickhull>
one approach that worked for me was a worker thread doing blocking reads, then taking action when the read completes
<rickhull>
now you've got a thread management / communication issue, but that can be relatively easier to deal with
<rickhull>
~~~depending~~~ :P
<Aloysius1>
rickhull: I'm running a bunch of processes that dump to stdout. NOt really doing much.
kstuart has quit [Quit: kstuart]
<rickhull>
i've not done a PTY.spawn
<rickhull>
but does that represent a user typing in commands, that you could call e.g. gets on?
<rickhull>
are you trying to merge / multiplex their output?
<rickhull>
"running a bunch of processes that dump to STDOUT" — where is the read()ing happening?
kstuart has joined #ruby-lang
stringly_typed has quit [Ping timeout: 252 seconds]
<Aloysius1>
Basically, I have a bunch of scripts that read and write to a queue, and they can be configured to dump to stdout.
<rickhull>
i.e. write to STDOUT instead of queue
<Aloysius1>
So I was putting together a monitor that can start, stop, collect the stdout, redirect it if necessary, etc.
<rickhull>
? or in addition to?
<rickhull>
writing the same messages? or a different sort of output?
<rickhull>
probably doesn't matter, i think get the gist
<Aloysius1>
It's data transformation. Data comes in point A, gets shoved into the queue, read by process B, transformed and pushed back into the queue, where it's picked up by processes C and D that push it some place else.
<rickhull>
i'd be tempted to do blocking reads with threads on each IO. or a select loop
<Aloysius1>
It's, like, data processing 101, if you're from the '60s. I like to imagine little operators running tapes from the shelves, mounting them on the drives...
<Aloysius1>
Right now, I'm envisioning an array of these spawned processes and just running through the array to see if there's any data.
<rickhull>
if a read blocks under the current approach, what is actually blocked? some other processing, or a read on a different IO?
<Aloysius1>
Well, this is all outside the actual work process, or as outside as I can make it. I probably should just have the work scripts log rather than dump to IO.
sepp2k1 has quit [Quit: Leaving.]
<Aloysius1>
Just Daemon-ize them.
<rickhull>
FYI: select() is designed to monitor an array of IOs and return the one has output ready to process
<Aloysius1>
But I kind of got into a thing where I said "Well, why should my scripts have to care whether they're run from the CLI or started by a process.)
<rickhull>
so select() itself will block, so that would block any auxiliary processing
<rickhull>
but it only blocks if all the IOs have nothing ready
tenderlove has quit [Remote host closed the connection]
<rickhull>
it won't block reading from IO.a if IO.b is ready
rsync has joined #ruby-lang
<rickhull>
er, i didn't explain that quite right
tenderlove has joined #ruby-lang
<Aloysius1>
Well, I'd like the monitor to be able to start and stop the processes. So I could use that...but I'd have to run it in a separate thread?
rwk1 has joined #ruby-lang
<rickhull>
as I see it, yeah. but maybe there is a clever way to avoid a thread
<rickhull>
select() has a configurable timeout, so that would be one way to do it. but not clever
<Aloysius1>
heh
<rickhull>
so you could block on select for 1 second, if nothing has any IO for you
<Aloysius1>
That gets close to what I'm doing without select, yeah.
<rickhull>
then do any necessary processing, then try select again
<rickhull>
but ugh
<rickhull>
my approach would be to keep the main thread running, and have a worker thread for each IO, blocking
<rickhull>
and dumping any messages into a shared queue
<rickhull>
which the main thread can consume and process
wmoxam has quit [Ping timeout: 252 seconds]
<Aloysius1>
*nod*
<zenspider>
I wanted more regexp trainwreck
<rickhull>
i'm a little concerned about what the main thread should be doing, and if it *ought* to block
<rickhull>
if there is "nothing to do"
<rickhull>
you mentioned start/stop processes
<rickhull>
what would trigger it do that?
<Aloysius1>
That would be user input.
<rickhull>
ok, so the main thread needs to be responsive to user input
rwk1 has quit [Ping timeout: 276 seconds]
<rickhull>
probably blocking on user input
tenderlove has quit [Ping timeout: 268 seconds]
<rickhull>
so a user input thread, and a main thread
<rickhull>
and the main thread blocks waiting for something to do
arooni-mobile has quit [Ping timeout: 276 seconds]
<rickhull>
either process user input, or IO
hahuang65 has joined #ruby-lang
<Aloysius1>
Yeah, that's probably sensible.
kstuart has quit [Quit: kstuart]
<rickhull>
could get hairy. could also take the same approach with select
<rickhull>
$stdin goes in the array of IOs
<Aloysius1>
Ah--I hadn't thought of that. Trying to think how that would work. I was going to tie this into something like HighLine.
<rickhull>
how comfortable are you with threads? understand the need for mutex/locking/synchronization?
<Aloysius1>
Pretty comfortable. I started back with OS/2. :-P
<rickhull>
cool. there are lots of pitfalls with the threaded approach, but easily manageable with the right awareness
andrewvos has joined #ruby-lang
<rickhull>
understanding how select operates can be tricky
<rickhull>
in this case, i might be tempted to try select
<Aloysius1>
Well, I'm doing this mostly as window dressing so it's not a bad idea to experiment with it.
davemaurakis has joined #ruby-lang
mrsolo has quit [Quit: This computer has gone to sleep]
<Aloysius1>
Ruby has a similar thread implementation to Smalltalk, I think? They're in-VM not the OS's, right?
<rickhull>
yeah, green threads
<rickhull>
jruby has OS threads
<rickhull>
rbx too?
<brixen>
mri 1.9+ has native threads with a global lock
<brixen>
JRuby and Rubinius have native threads with no global lock
<rickhull>
i use threads in ruby mainly to manage blocking reads. not for trying to maximize e.g. CPU usage
<rickhull>
brixen: ah, thx
<Aloysius1>
brixen: good to know
x0f_ has quit [Ping timeout: 245 seconds]
x0f has joined #ruby-lang
pskosinski has quit [Ping timeout: 240 seconds]
smook2 has joined #ruby-lang
mdedetrich has joined #ruby-lang
x0f has quit [Ping timeout: 264 seconds]
x0f has joined #ruby-lang
smook2 has quit [Ping timeout: 255 seconds]
arooni-mobile has joined #ruby-lang
<rickhull>
Aloysius1: i tried to make a toy select example, and it doesn't work, heh
<rickhull>
it's been a long time since i've messed with it
<Aloysius1>
Heh.
<rickhull>
one problem is that you don't know how to much to read
<rickhull>
only that there is some data.
rwk1 has joined #ruby-lang
kstuart has joined #ruby-lang
<Aloysius1>
Correct. And it could be wildly variable.
<rickhull>
i'm sure there is some flavor of read that will handle that without blocking
<rickhull>
but then you're back to the problem of buffering and maintaining state
<Aloysius1>
Only that there MIGHT be some data, even.
<rickhull>
since we're talking files, i assume you are using a newline boundary between "messages"
kstuart has quit [Client Quit]
<Aloysius1>
Well, the data itself is passing through queues. It never gets to be a file. I could preface the messages with a length. But I'm trying to keep my scripts ignorant.
<rickhull>
the last system i worked on involving these things did in fact use a 2 (or 4, depending) byte length header
<rickhull>
and i implemented it with threads. so each thread logic was very simple
<rickhull>
length = read(2)
<rickhull>
msg = read(length)
<rickhull>
do_something(msg)
<rickhull>
pseudocode, obviously
arooni-mobile has quit [Ping timeout: 252 seconds]
andrewvos has quit [Ping timeout: 252 seconds]
<rickhull>
blocking reads on everything
andrewvos has joined #ruby-lang
rwk1 has quit [Ping timeout: 240 seconds]
<Aloysius1>
Very Pascal. ReXX, too, did that. I thought it was slick but, no, we gotta have terminating nulls.
<rickhull>
yeah, seen djb netstrings?
<Aloysius1>
Nope.
justinmburrous has joined #ruby-lang
<Aloysius1>
Ha. Looks cool.
<rickhull>
so i think you can use readpartial with select
<rickhull>
select guarantees it won't block
<rickhull>
and you can slurp whatever is there with readpartial
<drbrain>
select only guarantees you can read 1 byte
<rickhull>
readpartial(255) when 1 byte is available
<drbrain>
and, maybe not even that
<rickhull>
should return that bye
<Aloysius1>
Yeah, I started with readpartial but had some trouble. I'll try it with select.
<drbrain>
yeah
<drbrain>
well, no, you should get one byte
<rickhull>
yeah, that's what i was saying, i think
<rickhull>
it seems the semantics here are that you never know when to stop reading
<rickhull>
so you're basically buffering a big blob
<rickhull>
have to decide what the granularity is, to multiplex or otherwise collect the outputs
tomzx has left #ruby-lang [#ruby-lang]
Asher has quit [Ping timeout: 260 seconds]
Asher1 has joined #ruby-lang
kstuart has joined #ruby-lang
kstuart has quit [Client Quit]
<rickhull>
otherwise, if you can rely on a newline, by convention, say
<rickhull>
i'd probably be tempted to call gets within a thread