Skip to content

Instantly share code, notes, and snippets.

@reporter123
Created November 3, 2016 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reporter123/c5fe3fbb5f95145a38be78da1874a27f to your computer and use it in GitHub Desktop.
Save reporter123/c5fe3fbb5f95145a38be78da1874a27f to your computer and use it in GitHub Desktop.
Magic file for shared-mime-info to reconize appleworks documents.
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-kdeuser1">
<comment>AppleWorks File</comment>
<magic-deleteall/>
<magic>
<match type="byte" offset="1" value="0x07">
<match type="string" offset="4" value="BOBO"/>
</match>
</magic>
<glob-deleteall/>
<glob pattern="*.CLW"/>
<glob pattern="*.clw"/>
</mime-type>
</mime-info>
@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Jun 22, 2022

@reporter123, why was “application/x-kdeuser1” chosen to represent AppleWorks Files? I ask because I have encountered that MIME-type when invoking the plain-text output of “script -a”, as this depicts. That consequential existent file is certainly not an “AppleWorks File”.

@reporter123
Copy link
Author

The MIME-type is just a unreserved user space designation. It means there is no official registration for it and I didn't have any other custom types on my machine using the name. Because these are not officially registered anywhere the type is not necessarily universally unique and my mean something else on another setup. Unless you are working with files for very old MacOS software you very unlikely to encounter an actual AooleWorks file.

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Jun 25, 2022

@reporter123, would "http://stackoverflow.com/a/1176031/9731176" not be superior? This situation appears to have already been standardized adequately.

@reporter123
Copy link
Author

reporter123 commented Jun 26, 2022

application/octet-stream is only for completely unknown types with no typing recognition at all. Don't install this file if that's what you want. application/octet-stream and similar are not applicable to custom type recognition. Using them as such would directly collide with the officially reserved purpose these types.

@RokeJulianLockhart
Copy link

@reporter123, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment