[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: MIME type meta-data

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-03-07 21:20:09 CET

Matthew Hambley wrote:

>My plan for a first cut at this problem was to implement a simple extension
>to type mapping. This should be simpler than scanning the files for magic.
>It will give us a chance to try out the feature. If it proves useful
>and/or the simple approach is insufficient then a more complicated one
>could be tried.
>
>Does anyone have any comments to make on the use, or not, of this map file
>format over mime.types?
>
>
Whatever you decide to use for the Unix implementation, *please* keep
dependencise on mime.types or file extensions out of the API, so that
other systems can implement different schemes. All you need for add and
import is one function for detecting the mime type, e.g.:

    svn_error_t *svn_mime_guess_type(const char **mime_type,
                                     const char *file_name,
                                     apr_pool_t *pool);

at the other end for checkout, update, and when the svn:mime-type
changes on an existing version-controlled file, you need something like:

    svn_error_t *svn_mime_assert_type(const char *mime_type,
                                      const char *file_name,
                                      apr_pool_t *pool);

That function would set any system-specific attrbutes on the file (e.g.,
on Risc OS) based on the mime_type parameter (we do something similar
today on Unix when the svn:executable property changes).

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 7 21:20:57 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.