分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
erlang启动参数有3种:emulator flags, flags 和plain arguments。
emulator flags 是以“+”开头的,用来控制模拟器的行为,附送一个非常实用的例子:
相关阅读:http://www.linuxidc.com/Linux/2011-07/39156.htm
- C:\>erl +V
- Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 5.8.2
flags 是以“-”开头的, 是erlang运行时系统的参数,可以用init:get_argument/1获得。
plain arguments 普通参数,在第一个flag参数前,或在-- flag之后,-extra后的参数都是普通参数。
- </pre><p><span class="bold_code">erl +W w -sname arnie +R 9 -s my_init -extra +bertie</span></p><p><strong></strong> </p><pre class="plain" name="code">% erl +W w -sname arnie +R 9 -s my_init -extra +bertie
- (arnie@host)1> init:get_argument(sname).
- {ok,[["arnie"]]}
- (arnie@host)2> init:get_plain_arguments().
- ["+bertie"]
Here +W w and +R 9 are emulator flags.-s my_init is an init flag, interpreted by init. -sname arnie is a user flag, stored by init. It is read by Kernel and will cause the Erlang runtime system to become distributed. Finally, everything after-extra (that is, +bertie) is considered as plain arguments.
Flags
-Application Par Val 把应用中的Par参数设置为值Val;
-args_file FileName 从文件FileName读取命令行参数;
-boot File 指定启动使用的boot文件,默认是 $ROOT/bin/start.boot,在这个目录下还有start_clean.boot,start_sasl.boot。如果需要sasl的话,就“-boot start_sasl ”; -boot_var Var Dir 代替$ROOT用的;-code_path_cache 不常用;
-compile Mod1 Mod2 ... 不推荐使用了,应该使用erlc;
-config Config 指定配置文件,这个是很有用的,比如在Programming Erlang里,就用到 erl -boot start_sasl -config elog3,其中文件全名是elog3.config,内容如下:- %% rotating log and minimal tty
- [{sasl,[
- {sasl_error_logger,false},
- %%define the parameters of the rotating log
- %%the log file directory
- {error_logger_mf_dir,"D:/erlang/otpexample/error_logs"},
- %% # bytes per log file
- {error_logger_mf_maxbytes,10485760}, %10 MB
- %%maximum number of logfiles
- {error_logger_mf_maxfiles,10}
- ]}].
配置的含义,请参考相关书籍;
-cookie Cookie 被-setcookie代替了;
-detached 脱离console,跑后台erlang进程用的&