Skip to content

Commit

Permalink
IsDevice function
Browse files Browse the repository at this point in the history
  • Loading branch information
pjdufour committed May 6, 2019
1 parent 808a2f8 commit 6ca761d
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 6ca761d

Please sign in to comment.