perlメモ:chmodでファイルのパーミッションを設定

perlでファイルのパーミッションを変更するにはchmodを使う。

chmod 0755, @executables;
chmod(0755,"./hogehoge.txt");

・第一引数はパーミッションで8進数の数値で指定する。(文字列はだめ)
・第二引数はパーミッションを変更するファイルをリスト又は単体で指定する。
戻り値:chmodは変更に成功したファイル数を返す。


▼chmod -perl.com
http://www.perl.com/doc/manual/html/pod/perlfunc/chmod.html
▼楽露店:perl
http://rakuroten.kumacchi.com/search/perl

(Visited 176 times, 1 visits today)

タグ :