Skip to content

FileFd

Description

Return the underlying fd. POSIX-only; on Windows this returns -1. Useful for syscalls that need a raw fd (e.g. isatty checks).

Usage example (Cross-references)

Usage examples (Cross-references)
    
        Str buffer = StrInit(&scratch);
        i32 fd     = FileFd(file);
    
        // Probe seekability: if FileSeek(0, CUR) succeeds, the underlying
    }
    
    i32 FileFd(const File *f) {
    #ifdef _WIN32
        (void)f;
Last updated on