Do You PHP はてブロ

Do You PHPはてなからはてブロに移動しました

自習メモ〜分散プログラミング

公開されているpdfをやってみるシリーズ(?)。今日は分散プログラミング。
まずは、分散ノードどうしで通信するための「マジッククッキー」と呼ばれる.erlang.cookieファイルを作成する必要がある。。。で、Windowsの場合は?書いてないので、マニュアルhttp://www.erlang.org/doc/doc-5.5.4/doc/getting_started/conc_prog.html#3.4を参照。

on Windows systems the home directory is the directory where pointed to by the $HOME environment variable - you may need to set this. On Linux or Unix you can safely ignore this and simply create a file called .erlang.cookie in the directory you get to after executing the command cd without any argument

ということで、必要に応じて環境変数HOMEを設定し、そこに.erlang.cookieを作ればいいようです。
以下、操作例ですがCygwinがインストールされてます。

D:\home\shimooka\erlang>set HOME=D:\home\shimooka\erlang
D:\home\shimooka\erlang>set home
HOME=D:\home\shimooka\erlang
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\shimooka
D:\home\shimooka\erlang>cat > .erlang.cookie
hogehoge
[CTRL+D]
D:\home\shimooka\erlang>erl -sname shimooka
Eshell V5.5.4  (abort with ^G)
(shimooka@galm1)1>

追記

WindowsXP+SP2でやってますが、どうも環境変数HOMEDRIVE+HOMEPATHに作られるみたいです。上記の例だと

  • HOMEDRIVE=C:
  • HOMEPATH=\Documents and Settings\shimooka

なので、結果的に

C:\Documents and Settings\shimooka

に作られました。