2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 14:56:29 +00:00

fs: Add IsRegularFile()

This commit is contained in:
Alexander Neumann 2017-12-23 12:12:36 +01:00
parent 09365cc4ea
commit e4fdc5eb76

13
internal/fs/helpers.go Normal file
View File

@ -0,0 +1,13 @@
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
}