Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'content/en/functions/os.Stat.md')
-rw-r--r--content/en/functions/os.Stat.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/content/en/functions/os.Stat.md b/content/en/functions/os.Stat.md
new file mode 100644
index 000000000..1e878d896
--- /dev/null
+++ b/content/en/functions/os.Stat.md
@@ -0,0 +1,33 @@
+---
+title: os.Stat
+description: Gets a file information of a given path.
+godocref:
+date: 2018-08-07
+publishdate: 2018-08-07
+lastmod: 2018-08-07
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [files]
+signature: ["os.Stat PATH"]
+workson: []
+hugoversion:
+relatedfuncs: [readDir]
+deprecated: false
+aliases: []
+---
+
+If your current project working directory has a single file named `README.txt` (30 bytes):
+```
+{{ $stat := os.Stat "README.txt" }}
+{{ $stat.Name }} → "README.txt"
+{{ $stat.Size }} → 30
+```
+
+Function [`os.Stat`][Stat] returns [`os.FileInfo`][osfileinfo].
+For further information of `os.FileInfo`, see [golang page][osfileinfo].
+
+
+[Stat]: /functions/os.Stat/
+[osfileinfo]: https://golang.org/pkg/os/#FileInfo