ENH Check for fileness

Otherwise, things like sockets would get confused with files