Even windows can do this, apparently:
http://msdn.microsoft.com/en-us/library/aa364960(VS.85).aspx
You can check if the handle is of type FILE_TYPE_CHAR.