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

This commit is contained in:
Oleg Lobanov committed 2020-11-24 11:37:31 +01:00
1 parent 9515ceeb42
commit 586d198d47
3 files changed
+35 -7

No files matched your search

+9
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
}