[SATLUG] checking for data file type and deleting (metadata search?)

Brad Knowles brad at shub-internet.org
Fri Jun 1 15:42:05 CDT 2007


On 6/1/07, Luis Garza wrote:

>  I believe that file looks at the i-node information and not the actual
>  file its self.

Traditionally, "file" does look at the directory and inode 
information, to see if the file is empty, etc....  However, it also 
looks at the "magic" number for the actual file itself, and then some 
versions will proceed to look at the actual contents of the file so 
that it can try to determine which language & character set is used 
(e.g., ASCII, ISO-8859-x, UTF-8/16 Unicode, EBCDIC, etc...).

>  I'm pretty sure,though I don't know of one, that CPAN has a PM that looks
>  at the files contents; like take the first 10 characters and compare it to
>  the magic file.

Traditionally, the "file" command will do this, as well as some other things.

Now, whether or not the version of "file" on your system will work 
this way, that's a completely different matter.

-- 
Brad Knowles <brad at shub-internet.org>, Consultant & Author
LinkedIn Profile: <http://tinyurl.com/y8kpxu>
Slides from Invited Talks: <http://tinyurl.com/tj6q4>

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


More information about the SATLUG mailing list