os.FileInfo

The Go interface describing a file, returned by os.Stat and f.Stat, with methods such as Name, Size and Mode.

In more detail

Size gives the length in bytes and Mode the file type and permission bits. It describes the file at the moment you asked; it does not stay up to date.

Example

fmt.Printf("%s: %d bytes, mode %s\n", info.Name(), info.Size(), info.Mode())

Related terms

Taught in

References