# classify_path

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_paths/classify_path)

Classify a path as existing, missing, or unreadable.

## Signature

```python
classify_path(
    path: Path,
) -> PathState
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `path` | `Path` | Yes | Filesystem path to probe. |

## Returns

`PathState`

`PathState.EXISTS` for a present path, `PathState.MISSING` for expected
absent-path errors, and `PathState.UNREADABLE` when `Path.stat()`
raises another `OSError` (e.g. a parent directory denies traversal).
The error is logged at debug level so an unreadable path is never
silently indistinguishable from a missing one.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e14e0adcbe78565ed3650e7f24b2a775d5437d25/libs/code/deepagents_code/_paths.py#L48)