[erlang-questions] os:cmd/1 does not work for ulimit -n

Oscar Hellström <>
Thu May 14 11:40:23 CEST 2009


AFAIK, os:cmd/1 will open a port for doing the OS command. This will 
spawn  a new OS process in which you're setting the ulimit. This doesn't 
affect the parent process however. You will need to do this in the shell 
before you start Erlang.

MAthuvathanan Mou. wrote:
> Hi all,
> 
> Using Linux (RedHat) I wanted to increase number of open files for that 
> session only (temporarily)
> 
> In the erl shell I did
> 
> erl
> Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [hipe] 
> [kernel-poll:false]
> 
> Eshell V5.5.5  (abort with ^G)
> 1> os:cmd('ulimit -n').
> "1024\n"
> 2> os:cmd('ulimit -n 2048').
> []
> 3> os:cmd('ulimit -n').    
> "1024\n"
> 4>
> 
> Why did open file not increase here?
> 
> Regards,
> 
> -- 
> Mathuvathanan Mou.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 
Oscar Hellström, 
Office: +44 20 7655 0337
Mobile: +44 798 45 44 773
Erlang Training and Consulting Ltd
http://www.erlang-consulting.com/



More information about the erlang-questions mailing list