1
0
mirror of https://github.com/golang/go synced 2024-11-21 16:04:45 -07:00

os: add ModeType constant to mask file type bits

This covers the lack of IsRegular comfortably:

    if stat.Mode()&os.ModeType == 0 { ... }

R=golang-dev, r, rsc, r, gustavo
CC=golang-dev
https://golang.org/cl/5440075
This commit is contained in:
Gustavo Niemeyer 2011-12-01 17:35:43 -02:00
parent 744fb52102
commit d2b77bb194

View File

@ -44,6 +44,9 @@ const (
ModeSetuid // u: setuid
ModeSetgid // g: setgid
// Mask for the type bits. For regular files, none will be set.
ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice
ModePerm FileMode = 0777 // permission bits
)