Top /
Alan言語仕様 /
Filesys パッケージ
Alan v0.15
Reference
Filesys パッケージ
Last updated:
|
|
Created:
| 2006-08-07
|
by Fumisky Wells
Filesys --ファイルシステãƒ
wikimini.al を作æˆã™ã‚‹ãŸã‚ã«ã§ã£ã¡ä¸Šã’ã¦ã¿ãŸãƒ‘ッケージã§ã™ã€‚
ファイルã®ä¸èº«ã®æ“作㯠file型を使ã„ã¾ã™ãŒã€ãれ以外ã®ãƒ•ã‚¡ã‚¤ãƒ«é–¢é€£ã®
æ“作(主ã«ã€ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªæ“作ã€ãƒ‘スåæ“作)ã¯ã“ã“ã«ç½®ã予定ã§ã™ã€‚
以下ã€è©³ç´°ã§ã™ã€‚
Diråž‹
ディレクトリを走査ã™ã‚‹ã‚¤ã‚¿ãƒ¬ãƒ¼ã‚¿ã§ã™ã€‚
メンãƒ
コンストラクタ
| init
| (str: dirpath)
| # コンストラクタ
|
全型共通メンãƒ
int:
| size
|
| # サイズ(byte)
|
固有メンãƒ
str: | get
|
| # イタレータ
|
以下ã€è©³ç´°ã§ã™ã€‚
Filesys.Dir.init(str: dirpath)
- 説明
- ディレクトリåを引数ã¨ã—ã¦ã€ãã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªä¸‹ã‚’走査ã™ã‚‹
Dir オブジェクトを生æˆã™ã‚‹ã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã§ã™ã€‚
- 例外
- VE_DIR_OPEN_FAIL
- 例
import
Filesys
end
# /etc 下をリスト
Dir: etc = "/etc"
for str:entry in etc do
if entry <> "." and entry <> ".." then
put(entry, "\n")
end
end
- SEE ALSO
-
int: Filesys.Dir.size
- 説明
- サイズ(ãƒã‚¤ãƒˆæ•°)ã‚’è¿”ã—ã¾ã™ã€‚
- 例
import
Filesys
end
put(Dir.size)
str: Filesys.Dir.get
- 説明
- Dirイタレータ(指定ã—ãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®èµ°æŸ»)ã®å®Ÿè¡Œã§ã™ã€‚
- 例外
- -
- 例
import
Filesys
end
# /etc 下をリスト
Dir: etc = "/etc"
for str:entry in etc do
if entry <> "." and entry <> ".." then
put(entry, "\n")
end
end
bool: Filesys.exist(str: path)
- 説明
- path ã§æŒ‡å®šã—ãŸãƒ•ã‚¡ã‚¤ãƒ«ãŒå˜åœ¨ã™ã‚‹ã‹ãƒã‚§ãƒƒã‚¯ã—ã¾ã™
- 例外
- -
- 例
import
Filesys
end
put(exist("/etc/passwd"), "\n") # must be true
put(exist("/etc/password"), "\n") # must be false
Top /
Alan言語仕様 /
Filesys パッケージ
Alan ver0.31