From: Austin Ziegler Date: 2007-12-13T23:18:08+09:00 Subject: Re: Modifying parent shell's attributes? On 12/13/07, John Wells wrote: > I asked this on the rails list, but received no traction. Since it's > more of a ruby question anyway, thought I'd give it a shot here. > > I have a problem with one of my rake tasks. It loads a very large yaml > file into the db, but because of the default limitation on stack size > in the Linux shell, the task craps out. Executing "ulimit -s 16384" > fixes the issue, and the task completes just fine. > > What I'd like to do within my task is this (in ruby-ish pseudo): > > if on_linux? > set_stack_of_running_shell_via_ulimit 16384 > end > > Is there any way to do this? Can I modify the attributes of the shell > that is running me? Check out the Process class; specifically getrlimit and setrlimit. It won't change the shell, but it will change Ruby. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca