Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/PrinceOfCookies/CookieOS/llms.txt

Use this file to discover all available pages before exploring further.

The File Explorer is a full-screen program that lets you browse the computer’s file system, inspect metadata for any file or directory, and open files directly in the CC:Tweaked edit editor — all without leaving CookieOS. It is launched from the Programs menu and requires no special peripherals.

Prerequisites

No peripheral attachments are required. The File Explorer works on any CookieOS computer.

Interface Layout

The screen is divided into three distinct panels drawn using CC:Tweaked window objects.

Top Panel (green border)

Spans the top of the screen and serves as the header bar. It displays the COI logo characters rendered in block pixels on the left side, a matching ICC mirror on the right side, and a live clock in the centre that refreshes every 5 seconds via os.startTimer.

Left Panel (red border)

Occupies the lower-left half of the screen. It lists the contents of the current directory, separated into directories and files:
  • Directories are shown in light-blue text.
  • Files are shown in green text.
  • The currently selected item is highlighted with a > prefix (also in light-blue).
Both groups are sorted alphabetically before display. Directories starting with or containing rom in their path are excluded from listing entirely (see note below).

Right Panel

Occupies the lower-right half of the screen, separated from the file listing by a yellow vertical line drawn at the horizontal midpoint of the red-bordered box. It shows metadata for the currently selected item using CookieOS’s fs.attributes2() extension:
FieldExample value
Size12.50 KB
Modified2 days, 3 hrs
Created1 day, 10 hrs
Read OnlyYes / No

Metadata fetch example

local attributes = fs.attributes2(selected, true)
local size = attributes.size      -- e.g. "12.50 KB"
local lastModified = attributes.modified  -- e.g. "2 days, 3 hrs"
local readOnly = attributes.readonly
The second argument true requests human-readable formatting. Without it, raw epoch values would be returned. All navigation is keyboard-driven.
KeyAction
Up arrowMove selection up
Down arrowMove selection down
EnterOpen the selected directory, or open the selected file in edit
BackspaceNavigate to the parent directory
F6Exit the File Explorer and return to the shell
When Enter is pressed on a file, the File Explorer calls shell.run("edit " .. selected) and then exits, handing control to the built-in CC:Tweaked editor. When pressed on a directory, the explorer navigates into it and pushes the new path onto an internal history stack, which Backspace pops from.

Directory History

The explorer maintains a Lua table named history that tracks every directory visited in the current session. The starting directory is always /. Backspace removes the last entry from history and returns to the previous path. Navigating forward with Enter appends the new path.
The rom/ directory and any path containing rom is intentionally excluded from the File Explorer’s listing. This directory is part of the CC:Tweaked read-only ROM and contains system programs and APIs. Its files cannot be modified, so hiding them keeps the explorer focused on user-accessible content.

Build docs developers (and LLMs) love