Improve file type detection
First try to use the filename. If it's not available, guess the filetype from the file contents, but only if the file handle is seekable.
Note that handle.isatty()
is not good enough. For example, a regular unix pipe is not connected to a tty, but is not seekable:
cat test.fa | fastools sanitise - -