Am Mittwoch, den 21.05.2008, 14:13 +0200 schrieb Graeme Geldenhuys: > Example: > > [EMAIL PROTECTED]:tmp$ ls -l untit* > -rw-r--r-- 1 graemeg graemeg 7280 2008-05-21 13:50 untitled1 > -rw-r--r-- 1 graemeg graemeg 2311 2008-05-21 13:51 untitled2 > -rw-r--r-- 1 graemeg graemeg 96256 2008-05-21 13:51 untitled3 > > Here it lists three files of different types. OpenDocument Text, Rich > Text and MS Word respectively. You have no idea knowing that from the > command line, other than using some hex editor to peak at the first 3-5 > bytes of the file (a process way above the avg user). > > As a test, I opened Nautilus. As with most Linux apps, it normally > detects the file via it's magic number or something, not the file > extension. The first two worked by simply double clicking on them, but > it had no idea what 'untitled3' was (MS Word document). Strange!
$ file unti* should do: $ file * Physik_Praktikum 6.xls: Microsoft Office Document Versuch 3a.doc: Microsoft Office Document Versuch 6a.doc: Microsoft Office Document Zugefestigkeit: directory Zugversuch.pdf: PDF document, version 1.4 So file does know at least ms-word documents. I think $ man file or $ man magic wil tell a lot about it. MAc does have a BSD userland too and thus there is magic (=the database for detecting file types). > Using file extensions simply gives you a nice fallback option (hint) as > to what mime type it is. Connecting applications and MIME types is a different thing. > > .linux or .elf > > I like .elf! :-) $ file enum enum: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically linked, stripped Hmmmm... ;) Marc _______________________________________________ Lazarus mailing list [email protected] http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
