#ruby-lang - Sun 11 Mar 2007 between 00:00 and 01:25

bitsweatarooni: puts
krunk-: I don't think so.. I don't know what's going on there
krunk-hm, is there a more low level way to parse a file in ruby or is this a case of should be done in C?
aroonibitsweat: so its enough to just do \n when i'm writing to a file?
ruby figures out to put each on a new line?
bitsweatputs always appends a newline to the string
or you can print "my string\n"
aroonibitsweat: bitsweat right but i need to do.... File.write("line1\nlin2\nlin3")
and have it be 3 separate lines in the file
illegal access mode rw ... when i do... File.open('filename', "rw") or even r+w
bitsweatarooni: ri File.open
those aren't valid modes
get pickaxe by your side, start using irb, and you're golden.
matadonNow all I need to do is figure out why a Ruby program that processes 25M of data requires 500M of RAM. *sigh*
Actually, that itself isn't so bad, but the fact that it slows to a crawl after the first third of the data has been parsed is frankly depressing. Nrr.
bitsweatmatadon: prob cause it's generating a lot of garbage?
technoweeniebecause you're being careless with memory?
matadonbitsweat: I kind-of gathered that, and I'm profiling the code right now to see where the biggest CPU hogs are, but I'm having a hard time of finding a good way to cut down on the garbage.
technoweenie: Got any good suggestions for tools that I can use to figure out where all that memory is being used/
arooniok i need to change group ownership for a file
but it looks like i have to do this with ints instead of strings
is there anyway around this
jontechey uh... real quick, can I put a variable in for shell like this: `ruby #{ file }.rb`
jp_tixjontec: yup
aroonihey folks
how do i move files that i've just created within File.open() (i'm still within the open()'s block)
nachosI dont think you can...
because when the block closes then it will try to close a phantom file.
maybe someone can enlighten you more, i dunno.
decafyou can't (I just started to learn ruby, but it doesn't seem possible)
arooni: what do you want to do exactly?
technoweenielogic would dictate you create the file where you want it to be created
aroonii think it is possible... FileUtils#move seems to do the trick :P
technoweenieor you just move it after its created
aroonitechnoweenie: well i normally would but i'm putting in an overly eager directory of asterisk
and it starts reading and running with files even if you're not done writing to it yet
nachosarooni: It may work on some platforms, i think it would work on most unices, but it would break on win32 ( since you cant move open files )
arooninachos: i've switched to linux permenently

Page: 2 9 16 23 30 37