github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/file/abspath.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: abspath - Functions - Configuration Language
     4  sidebar_title: abspath
     5  description: The abspath function converts the argument to an absolute filesystem path.
     6  ---
     7  
     8  # `abspath` Function
     9  
    10  `abspath` takes a string containing a filesystem path and converts it
    11  to an absolute path. That is, if the path is not absolute, it will be joined
    12  with the job file directory.
    13  
    14  Referring directly to filesystem paths in job arguments may cause spurious
    15  diffs if the same configuration is applied from multiple systems or on
    16  different host operating systems. We recommend using filesystem paths only for
    17  transient values, such as the argument to
    18  [`file`](/docs/job-specification/hcl2/functions/file/file) (where only the contents are then
    19  stored).
    20  
    21  ## Examples
    22  
    23  ```shell-session
    24  > abspath("nomad.txt")
    25  /home/user/some/nomad-job/nomad.txt
    26  ```