Interface FILE

FILE prototype

Hierarchy

  • FILE

Methods

  • Clear the error indication.

    Returns void

  • Close the file. Return 0 if OK or -errno in case of I/O error.

    Returns number

  • Return true if end of file.

    Returns boolean

  • Return true if there was an error.

    Returns boolean

  • Flush the buffered file.

    Returns void

  • Return the next byte from the file. Return -1 if the end of file is reached.

    Returns number

  • Return the next line from the file, assuming UTF-8 encoding, excluding the trailing line feed.

    Returns string

  • Formatted printf.

    The same formats as the standard C library printf are supported. Integer format types (e.g. %d) truncate the Numbers or BigInts to 32 bits. Use the l modifier (e.g. %ld) to truncate to 64 bits.

    Parameters

    • format: string
    • Rest ...args: any[]

    Returns number

  • Write one byte to the file.

    Parameters

    • c: number

    Returns number

  • Outputs the string with the UTF-8 encoding.

    Parameters

    • str: string

    Returns void

  • Read length bytes from the file to the ArrayBuffer buffer at byte position position (wrapper to the libc fread).

    Parameters

    • buffer: ArrayBuffer
    • position: number
    • length: number

    Returns number

  • Read max_size bytes from the file and return them as a string assuming UTF-8 encoding. If max_size is not present, the file is read up its end.

    Parameters

    • Optional max_size: number

    Returns string

  • Seek to a give file position (whence is std.SEEK_*). offset can be a number or a bigint. Return 0 if OK or -errno in case of I/O error.

    Parameters

    • offset: number
    • whence: number

    Returns number

  • Return the current file position.

    Returns number

  • Return the current file position as a bigint.

    Returns bigint

  • Write length bytes to the file from the ArrayBuffer buffer at byte position position (wrapper to the libc fwrite).

    Parameters

    • buffer: ArrayBuffer
    • postion: number
    • length: number

    Returns number

Generated using TypeDoc