Re: [Nautilus-list] Re: Using the file(1) command to get information about the document format



On 08Oct2001 10:52AM (+0200), Paolo Pumilia wrote:
> >From Darin Adler, Sun Oct 07, at 11:33:
>  .Why did you bring this up? Is there some particular type of file that the
>  .file(1) command gets right, but Nautilus (and therefore gnome-vfs) gets
>  .wrong?
> 
> no..
> i was suggesting to use file(1) to determine the file type, so as to open 
> each file with the right application, even when the file extension is missing
> or when that file has been compressed. 
> In the latter case, i guess that file(1) should be executed twice: first to 
> determine the compression format, then, after decompression, to determime 
> the data format.
> 

gnome-vfs already has similar logic to `file'; it looks at magic
numbers inside the file data. It doesn't just trust the
extension. Try renaming a .gif file to .png and check the mime type
in nautilus to see an example of this in action.

I think actually executing the `file' command would be _extremely_
slow.

 - Maciej




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]