Skip to main content
Log in

Mojo function

open

open[PathLike: PathLike](path: PathLike, mode: String) -> FileHandle

Opens the file specified by path using the mode provided, returning a FileHandle.

Parameters:

  • PathLike (PathLike): The a type conforming to the os.PathLike trait.

Args:

  • path (PathLike): The path to the file to open.
  • mode (String): The mode to open the file in (the mode can be "r" or "w").

Returns:

A file handle.

Was this page helpful?