2017-12-23 12:12:36 +01:00
|
|
|
package fs
|
|
|
|
|
2020-02-17 00:20:38 +01:00
|
|
|
import "os"
|
2017-12-23 12:12:36 +01:00
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|
|
|
|
|
2020-09-17 10:22:15 +02:00
|
|
|
return fi.Mode()&os.ModeType == 0
|
2017-12-23 12:12:36 +01:00
|
|
|
}
|