fix: fix hanging when reading a named pipe file (closes #1155)

This commit is contained in:
Oleg Lobanov
2020-11-24 11:32:23 +01:00
parent 9515ceeb42
commit 586d198d47
3 changed files with 35 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
package files
import (
"os"
"unicode/utf8"
)
@@ -48,3 +49,11 @@ func isBinary(content []byte, _ int) bool {
}
return false
}
func IsNamedPipe(mode os.FileMode) bool {
return mode&os.ModeNamedPipe != 0
}
func IsSymlink(mode os.FileMode) bool {
return mode&os.ModeSymlink != 0
}