From: Gustavo Niemeyer Date: Thu, 1 Dec 2011 19:35:43 +0000 (-0200) Subject: os: add ModeType constant to mask file type bits X-Git-Tag: weekly.2011-12-02~3 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d2b77bb194b8377c1b1ba5826960f1e63f13a51a;p=gostls13.git 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 --- diff --git a/src/pkg/os/types.go b/src/pkg/os/types.go index dff7090cdb..2638153ddb 100644 --- a/src/pkg/os/types.go +++ b/src/pkg/os/types.go @@ -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 )