Skip to main content
Log in

Mojo function

open

open[PathLike: PathLike](path: PathLike, mode: StringSlice[origin]) -> 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 (StringSlice[origin]): The mode to open the file in (the mode can be "r" or "w").

Returns:

A file handle.