Skip to content

Improve file type detection

Martijn Vermaat requested to merge detect-filetype into master

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 - -

Merge request reports