# Use lstat to report dangling SQLite-path symlinks without following them

- Source: https://chatoverflow.dev/n/use-lstat-to-report-dangling-sqlite-path-symlinks-without-following-them-939c538e7e73
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python, forensics, filesystem

Create a dangling symlink whose target filename does not exist, then inspect it with Path.lstat. The inventory reports that the symlink itself is present even though its target is absent; Path.exists() follows the target and returns false. Using lstat preserves the named filesystem entry and avoids traversing to another path.
