Skip to main content

📂 lsoph

TUI that lists open files for a given process — a live, colour-coded view of every file a program (and its children) touches, updated as it happens.

Usage:

uvx lsoph -p <pid>          # attach to a running process (and its descendants)
uvx lsoph -c <command ...>  # launch a command and monitor it
uvx lsoph -b <backend> ...  # force a specific backend

Backends

lsoph auto-detects which backends are usable on your machine (the required tool must be installed, or a C compiler present) and picks the best available. There are two kinds:

  • Tracers stream real file events — open, read, write, close, stat, rename, unlink — from an external tracing tool. Accurate and complete, but usually need privilege.
  • Pollers snapshot each process's open files on an interval. Portable and low-privilege, but they miss short-lived files and can't see actual I/O.
Backend OS Kind Needs Notes
strace 🐧 tracer ptrace (root to attach*) default & best supported
preload 🐧😈 preload a C compiler (no root) run mode only; LD_PRELOAD shim
truss 😈☀️ tracer privilege FreeBSD / Solaris
dtruss 🍏😈 tracer root (+ SIP off on macOS) DTrace-based
ktrace 😈 tracer privilege OpenBSD / NetBSD / FreeBSD
fs_usage 🍏 tracer root macOS
etw 🪟 tracer admin ETW Kernel-File events
psutil 🐧🍏😈🪟 poller — open files only
lsof 🐧🍏😈 poller — open files only

🐧 Linux · 🍏 macOS · 😈 BSD · ☀️ Solaris · 🪟 Windows

* Under the default kernel.yama.ptrace_scope=1, strace can only attach to your own descendants. To attach to an arbitrary PID, run with sudo, lower the scope, or setcap cap_sys_ptrace+ep $(command -v strace). Run mode (-c) works without any of that.

The strace, preload, psutil and lsof backends are exercised on Linux. The BSD/macOS tracers (truss, dtruss, ktrace, fs_usage) are built and tested against their documented output formats but still want a smoke-test on real hardware — reports welcome. etw is built against the documented Kernel-File event layouts and smoke-tested under Wine (where the session APIs work but events don't flow); it wants validation on real Windows.

Future?

  • Native Linux backends — fanotify, or eBPF (bpftrace / BCC)
  • osquery — one polling backend, three OSes
  • gdb / lldb debugger-scripting backends (cross-platform, slow)
  • DYLD_INSERT_LIBRARIES shim for macOS (the preload sibling)

Note: inotify is intentionally absent — it watches paths, not processes, and doesn't report which PID caused an event. fanotify is the right Linux API.

Release files for lsoph 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lsoph 0.2.0
File Size Uploaded
lsoph-0.2.0.tar.gz 89.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lsoph 0.2.0
File Interpreter ABI Platform
lsoph-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 201.0 kB

Release files / lsoph-0.2.0.tar.gz

Download URL lsoph-0.2.0.tar.gz
Size 89.5 kB
Tags Source
SHA-256 checksum
How to use checksums
32a500bd17a70e22e33705c56a5fd410525bf7d0ef24532a9c31e26151a61a20
BLAKE2b-256 checksum
How to use checksums
13fc80b7e8ca99d45329f769e0b92aeb972bb629b29ffb141cb9c01e20bd2c50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release files / lsoph-0.2.0-py3-none-any.whl

Download URL lsoph-0.2.0-py3-none-any.whl
Size 111.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7efe8f346850c731be0a797ec69e90b281f1e3cd9416eef8b73d4ce4b8b211b7
BLAKE2b-256 checksum
How to use checksums
38c38375b02471d7b94f8c31177520fcfd97e5163bd9efe37c531313741c56b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page