-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add notes for
os.Stat
(Hugo 0.47) (#557)
- Loading branch information
1 parent
e49f65b
commit af14497
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters