Skip Menu |

This queue is for tickets about the File-LibMagic CPAN distribution.

Report information
The Basics
Id: 28220
Status: rejected
Priority: 0/
Queue: File-LibMagic

People
Owner: Nobody in particular
Requestors: anonymous [...] remailer.cyberiade.it
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: allow adding of magic lines
Date: 15 Jul 2007 09:40:33 +0200
To: bug-File-LibMagic [...] rt.cpan.org
From: Cyberiade.it Anonymous Remailer <anonymous [...] remailer.cyberiade.it>
allow adding of individual magic lines. that way if you only want to define a few new magic identifiers, you don't have to copy the system one and add your custom lines to it. you can read in the system file, then add a few lines like so: my $magic = File::LibMagic->new('/usr/share/file/magic.mime'); while (my $line = <DATA>) { chomp $line; $magic->add_magic($line); }
File::LibMagic is just a thin layer for libmagic written by Christos Zoulas and in libmagic there is no function simular to "add_magic". option A: Ask him to implement one in libmagic, then File::LibMagic will use it. option B: Just write your data into a file and load it via magic_load. Andreas On So. 15. Jul. 2007, 03:35:26, anonymous@remailer.cyberiade.it wrote: Show quoted text
> allow adding of individual magic lines. that way if you only > want to define a few new magic identifiers, you don't have > to copy the system one and add your custom lines to it. you > can read in the system file, then add a few lines like so: > > my $magic = File::LibMagic->new('/usr/share/file/magic.mime'); > while (my $line = <DATA>) { > chomp $line; > $magic->add_magic($line); > } >