Usually, the file command relies on the "magic" bytes at the start of a file. Usually these signatures are stored in a file named /etc/magic. There are modules that either include such a database or can reuse such a file. Most are found by Magic (resp. MMagic for File::MMagic).
In reply to Re: file command replacement (showing the type of a file with perl)
by Corion
in thread file command replacement (showing the type of a file with perl)
by pvaldes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |