o
odin.langpkg.dev
packages / library / ozap

ozap

8422b2blibrary

No description provided.

No license · updated 4 weeks ago

ozap

ozap is a small Odin utility that moves media files from the macOS Desktop into a dated backup folder.

The current program scans /Users/kevintung/desktop for regular files with these extensions:

  • .png
  • .jpg
  • .jpeg
  • .mov

Matching files are moved into /Users/kevintung/backup_screenshots/YYYYMMDD, where YYYYMMDD is the current local date.

Repository layout

.
├── main.odin   # Odin source for the backup utility
└── README.md   # Project overview and usage notes

Requirements

  • Odin compiler installed and available as odin
  • macOS-style source and destination paths, as currently hard-coded in main.odin

Verified locally with:

odin version dev-2026-05:ea5175d86

Build

Check the project:

odin check .

Build an executable:

odin build . -out:ozap

Run

After building:

./ozap

Or run directly with Odin:

odin run .

When a file is moved successfully, the program prints a message like:

done archive: /Users/kevintung/backup_screenshots/20260610/example.png

Behavior notes

  • Files are moved with os.rename, not copied.
  • The destination date folder is created automatically if it does not already exist.
  • Existing destination files with the same name may be replaced on macOS because the program uses os.rename.
  • The source directory, destination directory, and allowed extensions are currently constants in main.odin.

Development

Useful command before committing changes:

odin check .