Class File

Provides basic filesystem access.

Hierarchy

  • File

Constructors

Methods

Constructors

  • Opens or creates the file at filePath with mode specifying how it should be opened. For example "wb" to open the file for writing in binary mode. This is the same format as fopen() from the C standard library.

    Parameters

    • filePath: string

      Path to file to open or create.

    • mode: string

      Mode to use.

    Returns File

Methods

  • Closes the file. You should call this function when you’re done with the file unless you are fine with this happening when the object is garbage-collected or the script is unloaded.

    Returns void

  • Flushes any buffered data to the underlying file.

    Returns void

  • Synchronously writes data to the file.

    Parameters

    Returns void

Generated using TypeDoc