FileIsOpen
Description
True if the underlying handle is currently open.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
PdbCache.c:88:
// (no libc fopen/fwrite/fclose).
File f = FileOpen(path, "w");
if (!FileIsOpen(&f))
return false;
bool ok = (u64)FileWrite(&f, data, size) == size;- In
MachoCache.c:44:
static bool write_file(const char *path, const u8 *data, u64 size) {
File f = FileOpen(path, "wb");
if (!FileIsOpen(&f))
return false;
bool ok = FileWrite(&f, data, size) == (i64)size;- In
File.c:17:
static bool write_test_file(const char *text, Str *out_path, Allocator *alloc) {
File f = FileOpenTemp(out_path, alloc);
if (!FileIsOpen(&f)) {
return false;
}- In
File.c:44:
File f = FileOpen(&path, "rb");
if (!FileIsOpen(&f)) {
FileRemove(&path);
StrDeinit(&path);- In
File.c:78:
File f = FileOpen(&path, "rb");
if (!FileIsOpen(&f)) {
FileRemove(&path);
StrDeinit(&path);- In
PdbCache.c:25:
static bool path_exists(const char *path) {
File f = FileOpen(path, "rb");
if (!FileIsOpen(&f)) {
return false;
}- In
Dns.c:224:
static bool slurp_file(const char *path, Str *out) {
File f = FileOpen(path, "rb");
if (!FileIsOpen(&f)) {
// Missing config file is fine -- resolver just won't know about it.
return true;- In
MachoCache.c:24:
static bool path_exists(const char *path) {
File f = FileOpen(path, "rb");
if (!FileIsOpen(&f)) {
return false;
} static bool path_exists(const char *path) {
File f = FileOpen(path, "rb");
if (!FileIsOpen(&f)) {
return false;
}- In
ProcMaps.c:170:
// empty -- we have to loop-read into a growing buffer ourselves.
File f = FileOpen("/proc/self/maps", "rb");
if (!FileIsOpen(&f)) {
LOG_ERROR("ProcMapsLoad: FileOpen(/proc/self/maps) failed");
ProcMapsDeinit(out);- In
File.c:223:
}
bool FileIsOpen(const File *f) {
if (!f) {
return false;- In
File.c:239:
i64 file_read(File *f, void *buf, u64 n) {
if (!FileIsOpen(f) || !buf) {
return -1;
}- In
File.c:276:
i64 FileWrite(File *f, const void *buf, u64 n) {
if (!FileIsOpen(f) || !buf) {
return -1;
}- In
File.c:304:
i64 FileSeek(File *f, i64 offset, FileWhence whence) {
if (!FileIsOpen(f)) {
return -1;
}- In
File.c:337:
bool FileFlush(File *f) {
if (!FileIsOpen(f)) {
return false;
}
Last updated on