ExTmpFs v0.1.0 ExTmpFs View Source

This module provide some functions for the wrapper of TmpFs System. He use System.cmd, so use sudo is preferable.

Link to this section Summary

Functions

Mount and create the directory to mount a tmpfs device

Umount and destroy the directory of mounting tmpfs device

Link to this section Types

Link to this type size() View Source
size() :: [size: non_neg_integer, type: size_type]
Link to this type size_type() View Source
size_type() :: :O | :K | :M | :G

Link to this section Functions

Link to this function mount(path, size) View Source
mount(path :: Path.t, size :: size) ::
  {:ok, atom} |
  {:error, term}

Mount and create the directory to mount a tmpfs device.

## Parameters

- path: Path.t
- size: size

## examples

 sudo iex -S mix
 iex> {:ok, ref} = ExTmpFs.mount(".tmp", [size: 1, size_type: :G])
Link to this function umount(name) View Source
umount(name :: atom) :: :ok | {:error, term}

Umount and destroy the directory of mounting tmpfs device.

## Parameters

- name: atom

## examples

 sudo iex -S mix
 iex> {:ok, ref} = ExTmpFs.mount(".tmp", [size: 1, size_type: :G])
 iex> :ok = ExTmpFs.umount(ref)