windows - is there any generic way to check os.Stdin or input redirected from null device? -
i check input redirected null device or not in go language.i got 1 way unix don't how deal windows or make generic.this did unix
fd := os.stdin.fd() fmt.print(fmt.sprint("/proc/self/fd/", fd)) filename, err1 := os.readlink(fmt.sprint("/proc/self/fd/", fd)) if err1 != nil { fmt.print(err1) } fmt.println("filename:", filename)
Comments
Post a Comment