App-local file storage.
Provides a thin Elixir wrapper over the device filesystem using named
locations instead of raw paths. Basic file operations (list, stat,
delete, copy, move, read, write) are pure File.* calls —
no NIF overhead except for the initial dir/1 path resolution.
Locations
:temp— ephemeral; may be purged by the OS at any time:documents— persists across app sessions; user-visible on iOSwhen `UIFileSharingEnabled` is set (see `mix mob.enable`):cache— persists until OS needs space; not user-visible:app_support— persists, hidden from user, backed up on iOS
Platform-specific storage
See Mob.Storage.Apple and Mob.Storage.Android for saving to the native
photo/media library and accessing platform-specific directories.
Results
Operations that can fail return {:ok, value} | {:error, posix}.
dir/1 raises on an unknown location atom.
Summary
Functions
Copy src to dest.
Delete a file.
Resolve a location atom to its absolute path on the current device.
Return the file extension including the leading dot, or "" if none.
List all files in a location or an absolute path.
Move src to dest.
Read a file's contents as a binary.
Return metadata for a file.
Write data to path.
Functions
Copy src to dest.
dest may be a location atom (file is placed there keeping its basename)
or a full absolute path.
Returns {:ok, dest_path} on success.
Delete a file.
Resolve a location atom to its absolute path on the current device.
Return the file extension including the leading dot, or "" if none.
No I/O — derived from the filename only.
Mob.Storage.extension("/tmp/clip.mp4") #=> ".mp4"
Mob.Storage.extension("/tmp/notes") #=> ""
List all files in a location or an absolute path.
Returns full paths, not just names.
Move src to dest.
dest may be a location atom or a full absolute path.
Returns {:ok, dest_path} on success.
Read a file's contents as a binary.
Return metadata for a file.
%{name: "clip.mp4", path: "/…/clip.mp4", size: 204_800,
modified_at: ~U[2026-04-24 10:00:00Z]}
Write data to path.
Returns {:ok, path} on success.