Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface File

Hierarchy

  • File

Implemented by

Index

Methods

chmod

chmodSync

  • chmodSync(mode: number): void
  • Optional: Synchronous fchmod.

    Parameters

    • mode: number

    Returns void

chown

chownSync

  • chownSync(uid: number, gid: number): void
  • Optional: Synchronous chown.

    Parameters

    • uid: number
    • gid: number

    Returns void

close

closeSync

  • closeSync(): void

datasync

datasyncSync

  • datasyncSync(): void
  • Supplementary: Synchronous datasync.

    Default implementation maps to syncSync.

    Returns void

getPos

  • getPos(): number | undefined
  • Core: Get the current file position.

    Returns number | undefined

read

  • read(buffer: Buffer, offset: number, length: number, position: number | null, cb: BFSThreeArgCallback<number, Buffer>): void
  • Core: Read data from the file.

    Parameters

    • buffer: Buffer

      The buffer that the data will be written to.

    • offset: number

      The offset within the buffer where writing will start.

    • length: number

      An integer specifying the number of bytes to read.

    • position: number | null

      An integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.

    • cb: BFSThreeArgCallback<number, Buffer>

      The number is the number of bytes read

    Returns void

readSync

  • readSync(buffer: Buffer, offset: number, length: number, position: number): number
  • Core: Read data from the file.

    Parameters

    • buffer: Buffer

      The buffer that the data will be written to.

    • offset: number

      The offset within the buffer where writing will start.

    • length: number

      An integer specifying the number of bytes to read.

    • position: number

      An integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.

    Returns number

stat

statSync

sync

syncSync

  • syncSync(): void

truncate

truncateSync

  • truncateSync(len: number): void
  • Core: Synchronous truncate.

    Parameters

    • len: number

    Returns void

utimes

utimesSync

  • utimesSync(atime: Date, mtime: Date): void
  • Optional: Change the file timestamps of the file.

    Parameters

    • atime: Date
    • mtime: Date

    Returns void

write

  • write(buffer: Buffer, offset: number, length: number, position: number | null, cb: BFSThreeArgCallback<number, Buffer>): void
  • Core: Write buffer to the file. Note that it is unsafe to use fs.write multiple times on the same file without waiting for the callback.

    Parameters

    • buffer: Buffer

      Buffer containing the data to write to the file.

    • offset: number

      Offset in the buffer to start reading data from.

    • length: number

      The amount of bytes to write to the file.

    • position: number | null

      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.

    • cb: BFSThreeArgCallback<number, Buffer>

      The number specifies the number of bytes written into the file.

    Returns void

writeSync

  • writeSync(buffer: Buffer, offset: number, length: number, position: number | null): number
  • Core: Write buffer to the file. Note that it is unsafe to use fs.writeSync multiple times on the same file without waiting for it to return.

    Parameters

    • buffer: Buffer

      Buffer containing the data to write to the file.

    • offset: number

      Offset in the buffer to start reading data from.

    • length: number

      The amount of bytes to write to the file.

    • position: number | null

      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

Generated using TypeDoc