---
page_title: abspath function reference
description: The `abspath` function converts an argument to an absolute filesystem path. Learn how to use the `abspath` function in Packer templates.
---

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
> [!IMPORTANT]  
> **Documentation Update:** Product documentation previously located in `/website` has moved to the [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs) repository, where all product documentation is now centralized. Please make contributions directly to `web-unified-docs`, since changes to `/website` in this repository will not appear on developer.hashicorp.com.
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

# `abspath` Function

`abspath` takes a string containing a filesystem path and converts it
to an absolute path. That is, if the path is not absolute, it will be joined
with the current working directory.

Referring directly to filesystem paths in resource arguments may cause spurious
diffs if the same configuration is applied from multiple systems or on
different host operating systems. We recommend using filesystem paths only for
transient values, such as the argument to
[`file`](/packer/docs/templates/hcl_templates/functions/file) (where only the contents are then
stored).

## Examples

```shell-session
> abspath(path.root)
/home/user/some/packer/root
```
