mirror of
https://github.com/restic/restic.git
synced 2024-12-24 00:37:28 +00:00
0d65b78168
Since Go 1.12, ModeCharDevice is included in ModeType: golang/go@a2a3dd00c9
13 lines
237 B
Go
13 lines
237 B
Go
package fs
|
|
|
|
import "os"
|
|
|
|
// IsRegularFile returns true if fi belongs to a normal file. If fi is nil,
|
|
// false is returned.
|
|
func IsRegularFile(fi os.FileInfo) bool {
|
|
if fi == nil {
|
|
return false
|
|
}
|
|
|
|
return fi.Mode()&os.ModeType == 0
|
|
}
|