Skip to content

Commit

Permalink
Merge pull request #28 from pjdufour/devices
Browse files Browse the repository at this point in the history
IsDevice function
  • Loading branch information
karrick committed May 6, 2019
2 parents 808a2f8 + 6ca761d commit 964ad4f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dirent.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func (de Dirent) IsRegular() bool { return de.modeType&os.ModeType == 0 }
// set.
func (de Dirent) IsSymlink() bool { return de.modeType&os.ModeSymlink != 0 }

// IsDevice returns true if and only if the Dirent represents a device file.
func (de Dirent) IsDevice() bool { return de.modeType&os.ModeDevice != 0 }

// Dirents represents a slice of Dirent pointers, which are sortable by
// name. This type satisfies the `sort.Interface` interface.
type Dirents []*Dirent
Expand Down

0 comments on commit 964ad4f

Please sign in to comment.