mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 12:12:10 -05:00
5fd1e74903
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
1 KiB
1 KiB
title | description | categories | keywords | action | aliases | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
os.Stat | Returns a FileInfo structure describing a file or directory. |
|
|
The os.Stat
function attempts to resolve the path relative to the root of your project directory. If a matching file or directory is not found, it will attempt to resolve the path relative to the contentDir
. A leading path separator (/
) is optional.
{{ $f := os.Stat "README.md" }}
{{ $f.IsDir }} → false (bool)
{{ $f.ModTime }} → 2021-11-25 10:06:49.315429236 -0800 PST (time.Time)
{{ $f.Name }} → README.md (string)
{{ $f.Size }} → 241 (int64)
{{ $d := os.Stat "content" }}
{{ $d.IsDir }} → true (bool)
Details of the FileInfo
structure are available in the Go documentation.