Omni.Tools.FileSystem.Entry (Omni Tools v0.1.0)

Copy Markdown View Source

Metadata for a file managed by the filesystem tool.

Built from an id (base-relative path) and the absolute path on disk. Content lives on disk; this struct is a lightweight view returned by write, patch, and list operations.

Entry.new("notes/todo.md", "/data/workspace/notes/todo.md")
#=> %Entry{id: "notes/todo.md", filename: "todo.md", media_type: "text/markdown", ...}

Summary

Types

t()

File metadata returned by filesystem operations.

Functions

Builds an entry from a base-relative id and the file's absolute path.

Types

t()

@type t() :: %Omni.Tools.FileSystem.Entry{
  filename: String.t(),
  id: String.t(),
  media_type: String.t(),
  mtime: DateTime.t(),
  size: non_neg_integer()
}

File metadata returned by filesystem operations.

Functions

new(id, abs_path)

@spec new(String.t(), String.t()) :: t()

Builds an entry from a base-relative id and the file's absolute path.

Reads size and mtime from disk via File.stat!/2. Derives filename from id and media_type from the file extension.