Re: [Nautilus-list] File associations not based on file extension



on 10/8/01 2:42 AM, Stormacq, Sébastien at S Stormacq aubay-si lu wrote:

> I am using StarOffice 6.0's new file format (based on XML).  The files
> produced by StarOffice Writer are zipped files, with a SXW extension.
> 
> Nautilus recognizes these files as zipped files, not taking into account the
> .sxw extension and the  settings I gave to gnome to associate .sxw and the
> StarOffice program.
> 
> How should I tell Nautilus to bypass the file recognition mechanism based on
> file structure (or internal ID I guess) and switch to a simple extension
> recognition ?

A couple of thoughts.

1) Using a file format that's always zipped, without any way of identifying
the files without decompressing, goes against the Unix tradition of being
able to identify files by magic number. It means that renaming a file and
changing its extension will make it impossible to open it with the right
program, removing one Unix advantage and lowering things to the Windows
level. I suggest that file formats for use on Unix machines have some way to
identify the file other than the extension, so that traditional tools like
file(1) and newer tools like gnome-vfs, can identify the files regardless of
extension.

2) The file mapping system is in gnome-vfs, so we may want to continue this
discussion on the gnome-vfs list. Nautilus uses the gnome-vfs system without
doing any additional logic.

3) This issue already came up with gnumeric, which also is using a file
format which is indistinguishable from any other compressed file. At the
moment, gnome-vfs has hardcoded into it, in the
gnome_vfs_sniff_buffer_looks_like_gzip function in the
gnome-vfs-mime-magic.c source file, a list of extensions which should not be
treated as gzip files even if they have the gzip file format. This allows
the other mappings to take precedence. So adding StarOffice 6.0's new file
format to the list will work.

4) It would be nice to have a long term solution to this in a future version
of gnome-vfs, as it looks like more and more people are deciding that the
best document format for their application is a gzip file without a unique
header outside the gzip format.

    -- Darin





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