openFile

Open a file in the Podโ€™s filesystem

class BrowserPod {
async openFile(path: string, mode: string): Promise<BinaryFile | TextFile>;
}

Parameters

  • path (string) - Path to an existing file
  • mode (string) - Opening mode. Either โ€œbinaryโ€ or โ€œutf-8โ€

Returns

openFile returns a Promise which is resolved when the operation has succeded. The promise resolves to a BinaryFile object if mode="binary", and to a TextFile object if mode="utf-8". If the file does not exist, the Promise will be rejected.

Was this page helpful?
Suggest changes