Basic Werk | Memo | Contact


MEMOMEM

Gauche_file_check



Gauche で Shell Script や Perl のように普通のファイルかとかチェックするには、



この辺りを使う。


(glob "*/") みたいなことも普通にできる。


こんな風に関数にまとめておくと便利かも



(define (-e x) (file-exists? x))
(define (-f x) (file-is-regular? x))
(define (-d x) (file-is-directory? x))


参考:

Gauche ユーザリファレンス

6.25.3.4 ファイルの状態

6.25.3.1 ディレクトリ


#Gauche #Scheme #Lisp #Shell



SN 2013/06/28 00:49:21

Archives > Gauche_file_check.html







MEMOMEM



More Contents

Basic Werk | Previous Blog

仕事と日 | 中村 心