# `F3.IO.FileSystem.OS`

`F3.IO.FileSystem` implementation that calls `File` and `:file`.

`stat/1` uses `File.stat/1`. `open/2`, `pread/3`, and `close/1` use the
Erlang `:file` module. Errors are the atoms those functions return.
They do not raise for a missing path.

# `close`

`:file.close/1` for an open descriptor.

## Examples

    iex> {:ok, fd} = F3.IO.FileSystem.OS.open("test/fixtures/small.f3", [:read, :binary])
    iex> F3.IO.FileSystem.OS.close(fd)
    :ok

# `open`

`:file.open/2` for `path` and `modes`.

## Examples

    iex> {:ok, fd} = F3.IO.FileSystem.OS.open("test/fixtures/small.f3", [:read, :binary])
    iex> :ok = F3.IO.FileSystem.OS.close(fd)
    iex> is_pid(fd) or is_reference(fd) or is_tuple(fd) or is_atom(fd)
    true

# `pread`

`:file.pread/3` for an open descriptor.

## Examples

    iex> {:ok, fd} = F3.IO.FileSystem.OS.open("test/fixtures/small.f3", [:read, :binary])
    iex> {:ok, "F3"} = F3.IO.FileSystem.OS.pread(fd, 4166, 2)
    iex> :ok = F3.IO.FileSystem.OS.close(fd)
    :ok

# `stat`

`File.stat/1` for `path`.

## Examples

    iex> {:ok, stat} = F3.IO.FileSystem.OS.stat("test/fixtures/small.f3")
    iex> stat.size
    4168

    iex> F3.IO.FileSystem.OS.stat("missing-file.f3")
    {:error, :enoent}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
