Forum > Third party
Magic4Lazarus
(1/1)
dead_fly:
You can retrieve the mime type from a file without using a wrapper of terminal (or prompt of command) to get the command 'file' (or 'file.exe') output.
Accessing directly the library now is possible:
http://code.google.com/p/magic4lazarus/
Tested on Linux Ubuntu 10.04 and Windows XP.
Thanks for the developer of 'file' and the port 'file.exe'!
kamischi:
If you add the following to magic4lazarus.pas, i seems to be fine on Mac OS X, too:
{$IFDEF DARWIN}
MAGIC_LIBRARY = 'libmagic.dylib';
{$linklib libmagic}
{$ENDIF}
After moving magic.mgc into this directory in the application bundle (filemimetest.app/Contents/MacOS) the example worked. fpc 2.4.0, lazarus 0.9.28.2
I don't expect it matters, but libmagic was installed as file (5.03) using fink.
dead_fly:
Thank you, I don't have a Mac OS to try so I couldn't add it.
It matters because MAGIC_LIBRARY is bundled on application File 5.03 (stable, but exists the source of 5.04).
Navigation
[0] Message Index