static File* CreateEmptyFile(constchar* name, int extra_flags) { // In case the file exists, unlink it so we get a new file. This is necessary as the previous // file may be in use and must not be changed.
unlink(name);
bool OS::FileExists(constchar* name, bool check_file_type) { struct stat st; if (stat(name, &st) == 0) { if (check_file_type) { return S_ISREG(st.st_mode); // TODO: Deal with symlinks?
} else { returntrue;
}
} else { returnfalse;
}
}
bool OS::DirectoryExists(constchar* name) { struct stat st; if (stat(name, &st) == 0) { return S_ISDIR(st.st_mode); // TODO: Deal with symlinks?
} else { returnfalse;
}
}
int64_t OS::GetFileSizeBytes(constchar* name) { struct stat st; if (stat(name, &st) == 0) { return st.st_size; // TODO: Deal with symlinks? According to the documentation, // the st_size for a symlink is "the length of the pathname // it contains, without a terminating null byte."
} else { return -1;
}
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.13Bemerkung:
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.