mirror of
https://github.com/octoleo/restic.git
synced 2024-11-05 12:57:53 +00:00
14 lines
257 B
Go
14 lines
257 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|os.ModeCharDevice) == 0
|
||
|
}
|