英語版
このページの英語版を見る

dmd.root.file

ディスクからファイルを読み込み、メモリに保存する。
Authors:

ソースroot/file.d

対象範囲 https://codecov.io/gh/dlang/dmd/src/master/src/dmd/root/file.d

struct Buffer;
(rmem 管理) バッファを所有している。
pure nothrow @nogc @safe ubyte[] extractSlice();
バッファの所有権を呼び出し側に移す。
struct File;
struct ReadResult;
pure nothrow @nogc @safe ubyte[] extractSlice();
バッファの所有権を呼び出し側に移す。
pure nothrow @nogc ubyte[] extractDataZ();
同上 返される配列のバッファの末尾にヌル終端文字を含める。
static nothrow bool read(const char[] name, ref OutBuffer buffer);
ファイルの全内容を読み込み、それを末尾に追加する。 buffer
Parameters: ファイル名に
char[] name ファイル名
OutBuffer buffer ファイルの内容が追加される
Returns: false = 成功、true = 失敗
false = 成功、true = 失敗
static nothrow bool write(const(char)* name, const void[] data);

static nothrow bool write(const(char)[] name, const void[] data);
ファイルを書き込む。成功した場合、true を返す。
static nothrow void remove(const(char)* name);
ファイルを削除する。
static nothrow bool update(const(char)* namez, const void[] data);

static nothrow bool update(const(char)[] name, const void[] data);
ファイルを更新する
ファイルが存在し、書き込む内容と同一である場合は、 単にファイルのタイムスタンプを更新する。 そうでない場合は、ファイルを書き込む。
書き込みは読み込みよりもはるかに遅いという考え方であり、ビルドシステムは しばしば同一のファイルを生成してしまう。
Parameters:
const(char)[] name 更新するファイルの名前
void[] data ファイルの更新内容
Returns:
true 成功した場合
static nothrow ulong size(const char* namez);
ファイルのサイズ(バイト単位)。
Parameters:
char* namez ヌル文字で終端するファイル名
Returns:
ulong.max エラーが発生した場合はnull終端のファイル名、それ以外は長さ。