[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Set ulimit when using subprocess.Popen?

Jarek Zgoda

1/28/2008 9:05:00 AM

Hi, all,

anybody has an idea on how to set ulimit (-v in my case, linux) for
process started using subprocess.Popen?

--
Jarek Zgoda
Skype: jzgoda | GTalk: zgoda@jabber.aster.pl | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)
3 Answers

Rob Wolfe

1/28/2008 1:36:00 PM

0



Jarek Zgoda napisal(a):
> Hi, all,
>
> anybody has an idea on how to set ulimit (-v in my case, linux) for
> process started using subprocess.Popen?

What about:

from subprocess import call
call('ulimit -v 1000 && ulimit -v && ls', shell=True)

HTH,
Rob

Jarek Zgoda

1/28/2008 1:59:00 PM

0

Rob Wolfe napisa3(a):
>
> Jarek Zgoda napisa3(a):
>> Hi, all,
>>
>> anybody has an idea on how to set ulimit (-v in my case, linux) for
>> process started using subprocess.Popen?
>
> What about:
>
> from subprocess import call
> call('ulimit -v 1000 && ulimit -v && ls', shell=True)

subprocess.Popen('ulimit -v 1024; ls', shell=True) works perfect.

Unfortunately, the nature of ulimit impacts deadly my application when
the limit is reached, so this knowledge is of no help in my case. ;)

--
Jarek Zgoda
Skype: jzgoda | GTalk: zgoda@jabber.aster.pl | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

Rob Wolfe

1/28/2008 2:26:00 PM

0



Jarek Zgoda napisal(a):
> Rob Wolfe napisa?(a):
> >
> > Jarek Zgoda napisa?(a):
> >> Hi, all,
> >>
> >> anybody has an idea on how to set ulimit (-v in my case, linux) for
> >> process started using subprocess.Popen?
> >
> > What about:
> >
> > from subprocess import call
> > call('ulimit -v 1000 && ulimit -v && ls', shell=True)
>
> subprocess.Popen('ulimit -v 1024; ls', shell=True) works perfect.
>
> Unfortunately, the nature of ulimit impacts deadly my application when
> the limit is reached, so this knowledge is of no help in my case. ;)

Use "ulimit -v unlimited" then.

RW