📂 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,psutilandlsofbackends 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.etwis 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 OSesgdb/lldbdebugger-scripting backends (cross-platform, slow)DYLD_INSERT_LIBRARIESshim 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.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lsoph-0.1.0.tar.gz | 79.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lsoph-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 180.6 kB
Release files / lsoph-0.1.0.tar.gz
| Download URL | lsoph-0.1.0.tar.gz |
|---|---|
| Size | 79.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
606ceb9de11628aec26783f53851a77e95809cb9dcd99e6d2f20689793757ca5
|
|
BLAKE2b-256 checksum How to use checksums |
09f792f6cd41f66e49e9a4b9c539d518d0e1a5082ceb8a90d02df11d99fb21e3
|
| 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.1.0-py3-none-any.whl
| Download URL | lsoph-0.1.0-py3-none-any.whl |
|---|---|
| Size | 101.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bef3bc44865002e08f137e1b69d44fc1ddf27db15b3bdca923c054f8225de57d
|
|
BLAKE2b-256 checksum How to use checksums |
4ed2ebb10fed363ebafd1548e411c277826e5a6d4c35e004bd5c659d40406954
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|