vendor/github.com/mattn/go-isatty/isatty_windows.go
changeset 260 445e01aede7e
parent 251 1c52a0eeb952
equal deleted inserted replaced
259:db4911b0c721 260:445e01aede7e
     1 // +build windows
     1 //go:build windows && !appengine
     2 // +build !appengine
     2 // +build windows,!appengine
     3 
     3 
     4 package isatty
     4 package isatty
     5 
     5 
     6 import (
     6 import (
     7 	"errors"
     7 	"errors"
    74 
    74 
    75 	return true
    75 	return true
    76 }
    76 }
    77 
    77 
    78 // getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler
    78 // getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler
    79 // since GetFileInformationByHandleEx is not avilable under windows Vista and still some old fashion
    79 // since GetFileInformationByHandleEx is not available under windows Vista and still some old fashion
    80 // guys are using Windows XP, this is a workaround for those guys, it will also work on system from
    80 // guys are using Windows XP, this is a workaround for those guys, it will also work on system from
    81 // Windows vista to 10
    81 // Windows vista to 10
    82 // see https://stackoverflow.com/a/18792477 for details
    82 // see https://stackoverflow.com/a/18792477 for details
    83 func getFileNameByHandle(fd uintptr) (string, error) {
    83 func getFileNameByHandle(fd uintptr) (string, error) {
    84 	if procNtQueryObject == nil {
    84 	if procNtQueryObject == nil {