Commit d2b77bb1 authored by Gustavo Niemeyer's avatar Gustavo Niemeyer

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
parent 744fb521
......@@ -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
)
......
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