operator
stream-name indexer? (is | isnt) file
You can use is file to test if a stream was opened as a file. Using isnt instead of is will reverse the results.
is file
isnt
is