summaryrefslogtreecommitdiffhomepage
path: root/pkg/abi/linux/file.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-03-26 15:52:19 +0000
committergVisor bot <gvisor-bot@google.com>2020-03-26 15:52:19 +0000
commitd369c5518d87e63f3a2f786112b0124133642abf (patch)
tree9c9b85c29baab22331e5da39d085fe281c447c2d /pkg/abi/linux/file.go
parentd5df82021a230a52a1a50442dbd77a84802b0b4d (diff)
parent7aa388ce744877f94854517df1080f42921422cb (diff)
Merge release-20200219.0-238-g7aa388c (automated)
Diffstat (limited to 'pkg/abi/linux/file.go')
-rw-r--r--pkg/abi/linux/file.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/abi/linux/file.go b/pkg/abi/linux/file.go
index dbe58acbe..055ac1d7c 100644
--- a/pkg/abi/linux/file.go
+++ b/pkg/abi/linux/file.go
@@ -287,6 +287,11 @@ func (m FileMode) ExtraBits() FileMode {
return m &^ (PermissionsMask | FileTypeMask)
}
+// IsDir returns true if file type represents a directory.
+func (m FileMode) IsDir() bool {
+ return m.FileType() == S_IFDIR
+}
+
// String returns a string representation of m.
func (m FileMode) String() string {
var s []string