<p>Thanks Steve for clearing this confusion.<br></p>
<p>Zeeshan A Zakaria</p>
<p>--<br>
<a href="http://www.ilovetovoip.com">www.ilovetovoip.com</a></p>
<p><blockquote type="cite">On 2010-08-25 3:16 PM, "Steve Edwards" <<a href="http://asterisk.org">asterisk.org</a>@<a href="http://sedwards.com">sedwards.com</a>> wrote:<br><br><p><font color="#500050">On Wed, 25 Aug 2010, Zeeshan Zakaria wrote:<br>
<br>> Apparently all Linux files have a mime type informati...</font></p>Linux files are just a byte stream. They do not have "mime type<br>
information stored in them."<br>
<br>
"file" works by examining the first x bytes of the file and comparing this<br>
to a "magic" file of "rules" to guess file types.<br>
<br>
For instance, a JPEG file starts with "0xff 0xd8 0xff 0xe1."<br>
<br>
The "-i" or "--mime" command line option causes file to display a "mime<br>
type" instead of a "more traditional human readable" one.<br>
<br>
The "hexdump" command will show you the "binary" contents of a file in a<br>
variety for formats:<br>
<br>
# Create a file with 2 lines<br>
$ printf "line 1\nline 2\n" >foo<br>
<br>
# Dump the file. Note that "0a" (newline, aka line-feed) is the line<br>
# ending character.<br>
$ hexdump -C foo<br>
00000000 6c 69 6e 65 20 31 0a 6c 69 6e 65 20 32 0a |line 1.line 2.|<br>
<br>
# file says it is just ASCII text, like all text files on Unix should be.<br>
$ file foo<br>
foo: ASCII text<br>
<br>
# Convert the file to DOS line endings<br>
$ unix2dos foo<br>
unix2dos: converting file foo to DOS format ...<br>
<br>
# Dump the file. Note that the line ending characters are now "0d"<br>
# (carriage return) and "0a" (newline).<br>
$ hexdump -C foo<br>
00000000 6c 69 6e 65 20 31 0d 0a 6c 69 6e 65 20 32 0d 0a |line 1..line 2..|<br>
<br>
# file says it has "funky" line endings.<br>
$ file foo<br>
foo: ASCII text, with CRLF line terminators<br>
<br>
CRLF = Carriage Return, Line Feed -- think of a typewriter. Watch the<br>
History Channel for more info.<br>
<br>
--<br>
Thanks in advance,<br>
-------------------------------------------------------------------------<br>
Steve Edwards <a href="mailto:sedwards@sedwards.com">sedwards@sedwards.com</a> Voice: +1-760-468-3867 PST<br>
Newline Fax: +1-760-731-3000<br>
<font color="#888888"><br>
--<br>
</font><p><font color="#500050">_____________________________________________________________________<br>-- Bandwidth and Colocation Pr...</font></p></blockquote></p>