# get_validated_relative_path

> **Function** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/tools/file_management/utils/get_validated_relative_path)

Resolve a relative path, raising an error if not within the root directory.

## Signature

```python
get_validated_relative_path(
    root: Path,
    user_path: str,
) -> Path
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/7c10a5fa327f6aaaf7c932822a9e5d144891406e/libs/community/langchain_community/tools/file_management/utils.py#L43)