[OSM-dev] Filename extensions for OSM files

David Paleino dapal at debian.org
Tue May 10 21:31:02 BST 2011


On Tue, 10 May 2011 20:58:40 +0200, Peter Körner wrote:

> Frederik mentioned mime-types, I'd suggest (not knowing if I'd break any
> convention using multiple + symbols):
> 
> application/x-osm+xml for .osm
> [..]

I'd suggest we should also implement some magic(5) lines for file(1).

$ file -i mazara_20110202.osm
mazara_20110202.osm: application/x-osm+xml; charset=utf-8
$ file mazara_20110202.osm
mazara_20110202.osm: OpenStreetMap XML dump, API 0.6

(I never worked with /etc/magic, but as it is a first try, it seems nice :) --
here's the code:

---8<---
0      string      <?xml 
>0     search/400  =\<osm       OpenStreetMap XML dump
>>20   search/400  version=   
>>>&0  regex       ["']0.3          \b, API 0.3
>>>&0  regex       ["']0.4          \b, API 0.4
>>>&0  regex       ["']0.5          \b, API 0.5
>>>&0  regex       ["']0.6          \b, API 0.6
!:mime application/x-osm+xml
--->8---

)

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://deb.li/dapal
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20110510/87d4a3fb/attachment.pgp>


More information about the dev mailing list