[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: Paul Lussier <pll_at_lanminds.com>
Date: 2003-03-04 22:30:07 CET

In a message dated: 04 Mar 2003 14:35:49 CST
Karl Fogel said:

>> I've had a look at the source and noticed that there is a function
>> svn_io_detect_mimetype which decides this value. Is the plan to use this
>> at some point to map some suitable identifier (file extensions for
>> instance) to a MIME type?
>
>If we can do so reliably. Are extensions considered reliable? I
>don't know what the conventional wisdom is on this subject.

I wouldn't say that file extensions are always reliable, however,
couldn't you use something like a "magic number" to determine the
file type, then map that to a mime-type?

The file(1) depends upon the /etc/magic and /usr/share/misc/magic
files, and maps the data returned from the stat(2) call to these
files to determine type. Granted, this is very UNIX centric, but if
other platforms don't natively contain these files, couldn't svn or
apr ship with their own versions for those platforms like file(1)
does?

Just a thought.

-- 
Seeya,
Paul
--
Key fingerprint = 1660 FECC 5D21 D286 F853  E808 BB07 9239 53F1 28EE
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.
	 If you're not having fun, you're not doing it right!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 4 22:32:37 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.