Function writeSync

  • Write buffer to the file specified by fd. Note that it is unsafe to use fs.write multiple times on the same file without waiting for it to return.

    Parameters

    • fd: number
    • data: ArrayBufferView

      Uint8Array containing the data to write to the file.

    • Optional offset: null | number

      Offset in the buffer to start reading data from.

    • Optional length: null | number

      The amount of bytes to write to the file.

    • Optional position: null | number

      Offset from the beginning of the file where this data should be written. If position is null, the data will be written at the current position.

    Returns number

  • Parameters

    • fd: number
    • data: string
    • Optional position: null | number
    • Optional encoding: null | BufferEncoding

    Returns number