Recent

Author Topic: Magic4Lazarus  (Read 6415 times)

dead_fly

  • Newbie
  • Posts: 3
Magic4Lazarus
« on: June 16, 2010, 12:55:35 pm »
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'!
« Last Edit: June 16, 2010, 03:00:12 pm by dead_fly »

kamischi

  • Full Member
  • ***
  • Posts: 177
Re: Magic4Lazarus
« Reply #1 on: June 16, 2010, 04:17:22 pm »
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.
« Last Edit: June 16, 2010, 04:19:01 pm by kamischi »
fpc 2.6.4, lazarus 1.4.0, Mac OS X, fink

dead_fly

  • Newbie
  • Posts: 3
Re: Magic4Lazarus
« Reply #2 on: June 16, 2010, 05:19:13 pm »
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).

 

TinyPortal © 2005-2018