-
Notifications
You must be signed in to change notification settings - Fork 2
directory en
Class of the directory. Like the File class, there are two ways of opening and closing and accessing the list of file names at once. Basically, I think that it only uses the method of obtaining the list of file names at a time.
> dir: Directory = new Directory("src/");
> dir.readdir();
byte.c
> dir.closedir();
readdir () continues to return a list of file names until it returns null. Normally you will loop until while returning null in the while statement. Next, I will show you how to get the list at once.
> Directory.entries ("src/");
list {src/byte.c, src/exception.c, src/script_ctime.c, ..., src/code.c}
You can get a list of filenames of type SortableList <String>
in entries. The first argument is the target directory.
> Directory.glob("src/", "*.c");
list {src/byte.c, ..., src/code.c}
glob gets a list of filenames matching globs. The first argument is the target directory. The second argument is glob.
> Directory.glob("*.clc");
list {./File.clc,./Container.clc,./Fundamental.clc,./Command.clc,./String.clc,./MyOwnLibrary.clc,./x.clc}
Using glob as one argument gives a list of file names matching the glob in the current directory.
- フリーフォーマット
- 変数と関数について
- 条件分岐と演算子
- 論理演算子
- ビット演算子
- ループ
- ブロック
- コメント
- アノテーション
- ナルエイブル
- プリミティブクラス
- 配列
- クラス
- クラスフィールドとクラスメソッド
- dynamic_class
- boxingとunboxing
- プリミティブ型とスペシャルフィールド
- スペシャルメソッド
- インターフェース
- 移譲
- モジュール
- ジェネリクス
- メソッドジェネリクス
- 関数
- 列挙型(enum)
- 自動setterとgetterの定義
- when文
- 変数の宣言の取り消し
- 例外処理
- 多重代入
- 代入時の自動キャスト
- C言語へのFFI
- ローカル変数の宣言
- メモリーセーフなポインタ
- 例外演算子
- 糖衣構文