Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IFile

Hierarchy

  • IFile

Index

Properties

Readonly canAppend

canAppend: boolean

Check if the stream is in append mode.

Readonly canRead

canRead: boolean

Check if the stream is in read mode.

Readonly canSeek

canSeek: boolean

Check if the stream is seekable.

Readonly canWrite

canWrite: boolean

Check if the stream is in write mode

Readonly fd

fd: number

Methods

close

  • close(): void
  • Closes the file associated with the stream and disassociates it.

    Returns void

flush

  • flush(): void
  • Flush the stream. If the given stream was open for writing (or if it was open for updating and the last i/o operation was an output operation) any unwritten data in its output buffer is written to the file.

    Returns void

read

  • read(bytes: NodeJS.ArrayBufferView, offset?: number, count?: number): number
  • Reads an array of count elements in bytes, from the stream and stores them in a buffer.

    Parameters

    • bytes: NodeJS.ArrayBufferView

      A buffer to read data into.

    • Optional offset: number

      The starting point in the buffer at which to begin reading into the buffer.

    • Optional count: number

      The number of bytes to read.

    Returns number

seek

  • Sets the position indicator associated with the stream to a new position.

    Parameters

    • offset: number

      Number of bytes to offset from origin.

    • origin: SeekOrigin

      Position used as reference for the offset.

    Returns void

setBufSize

  • setBufSize(size: number): void
  • Specify the size of the underlying buffer for file buffering. The default size is probably 4096 on most systems.

    Parameters

    • size: number

      Desired size of the underlying buffer. Use the value 0 to disable file buffering.

    Returns void

tell

  • tell(): number
  • Returns the current value of the position indicator of the stream.

    Returns number

write

  • write(bytes: NodeJS.ArrayBufferView, offset?: number, count?: number): void
  • Writes an array of count elements in bytes, from the buffer to the current position in the stream.

    Parameters

    • bytes: NodeJS.ArrayBufferView

      A byte array containing the data to write.

    • Optional offset: number

      The index of the first byte to read from buffer and to write to the file.

    • Optional count: number

      The number of bytes to read from buffer and to write to the file.

    Returns void

Generated using TypeDoc