Interface File

The File module provides access to the file system.

All path-related API can use special path prefixes as "pseudo folders" to access some directories without specifying the absolute path. Available pseudo folders are:

  • @tmp/: the plugin's temporary directory. There is no guarantee that the files in this directory will be kept after IINA quits.
  • @data/: the plugin's data directory.
  • @video/:id, @audio/:id, @sub/:id: the video, audio, and subtitle files of the current playing media. :id is the track ID.

Hierarchy

  • File

Methods

  • Parameters

    • path: string
    • options: Partial<{
          includeSubDir: boolean;
      }>

    Returns {
        filename: string;
        path: string;
        isDir: boolean;
    }[]

  • Check if a file or directory exists.

    Parameters

    • path: string

      The path to the file or directory.

    Returns boolean

  • Write text content to a file.

    Parameters

    • path: string

      The path to the file.

    • content: string

      The string to write.

    Returns void

  • Read from a text file.

    Parameters

    • path: string

      The path to the file.

    • Optional options: Partial<{}>

      Currently unused.

    Returns string

  • Trash a file.

    Parameters

    • path: string

      The path to the file.

    Returns void

  • Delete a file immediately.

    Parameters

    • path: string

      The path to the file.

    Returns void

  • Show the file or directory in Finder.

    Parameters

    • path: string

      The path to the file or directory.

    Returns void

  • Read or write binary data from a file.

    Parameters

    • path: string

      The path to a file.

    • mode: string

      Can be either read or write.

    Returns FileHandle

Generated using TypeDoc