mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-09-11 17:46:08 +03:00
parent
fc93c355de
commit
6bde867d08
@ -18,13 +18,14 @@ func FolderExists(folderpath string) bool {
|
||||
}
|
||||
|
||||
// HasStdin determines if the user has piped input
|
||||
func HasStdin() bool {
|
||||
fi, err := os.Stdin.Stat()
|
||||
func hasStdin() bool {
|
||||
stat, err := os.Stdin.Stat()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if fi.Mode()&os.ModeNamedPipe == 0 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
isPipedFromChrDev := (stat.Mode() & os.ModeCharDevice) == 0
|
||||
isPipedFromFIFO := (stat.Mode() & os.ModeNamedPipe) != 0
|
||||
|
||||
return isPipedFromChrDev || isPipedFromFIFO
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user