• For detailed information, see the documentation of the asynchronous version of this API: write.

    Since

    v0.1.21

    Returns

    The number of bytes written.

    Parameters

    • fd: number
    • buffer: ArrayBufferView
    • Optional offset: null | number
    • Optional length: null | number
    • Optional position: null | number

    Returns number

  • Synchronously writes string to the file referenced by the supplied file descriptor, returning the number of bytes written.

    Parameters

    • fd: number

      A file descriptor.

    • string: string

      A string to write.

    • Optional position: null | number

      The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.

    • Optional encoding: null | BufferEncoding

      The expected string encoding.

    Returns number