Commit 0d0eff71 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

os: add FileMode.IsRegular

API change.

R=golang-dev, r, iant, rsc
CC=golang-dev
https://golang.org/cl/6844048
parent 1395d3d9
......@@ -88,6 +88,12 @@ func (m FileMode) IsDir() bool {
return m&ModeDir != 0
}
// IsRegular reports whether m describes a regular file.
// That is, it tests that no mode type bits are set.
func (m FileMode) IsRegular() bool {
return m&ModeType == 0
}
// Perm returns the Unix permission bits in m.
func (m FileMode) Perm() FileMode {
return m & ModePerm
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment