questions/22827465/what-perl-module-turns-a-file-extension-txt-jpeg-into-a-mime-type-text-pla/22832209#22832209>,
and the answer suggests MIME::Types, but also suggests some content introspection,
for which File::Type and File::MimeInfo::Magic get a mention.
I have never used any of these,
erl-module-turns-a-file-extension-txt-jpeg-into-a-mime-type-text-pla/22832209#22832209>,
and the answer suggests MIME::Types, but also suggests some content
introspection, for which File::Type and File::MimeInfo::Magic get a mention.
I have never used any of these, so I cannot vouch for them myse
Hi,
what´s the best way to find out of what type a file is?
I´ll probably be having a list of available files and another
list of the types I´ll be interested in, and it needs to be
determined which files in the list of available files need to
be processed further and which ones are to be ignor
In case you are working on Unix, you can call the command on '*file*'
through Perl's function - '*system*'
Cheers,
Parag
On Tue, Apr 13, 2010 at 9:52 AM, Arun P Menon wrote:
> Hi All,
>
> Could you tell which is the best perl module for finding file type?
&
Hi All,
Could you tell which is the best perl module for finding file type?
I am currently using File::Type but its missing out some (Shared
libraries, c programs etc...). Is there any modules to search those
files.
--
Regards,
Arun Menon
--
To unsubscribe, e-mail: beginners-unsubscr
Amit Saxena wrote:
Hi all,
Hello,
How to determine the file type of a file passed as an input to the perl
program ?
I want to have the same output as it's shown by "file" command in UNIX.
"file" uses a database called /etc/magic to determine the file type.
Al
On Thu, Nov 20, 2008 at 07:15, Amit Saxena <[EMAIL PROTECTED]> wrote:
snip
> Before posting this query here, I indeed did a sample search on CPAN.
>
> However I want to have a solution using Perl inbuilt module instead of some
> external module as the system I am working on does not allows perl ext
On Thu, Nov 20, 2008 at 6:59 PM, Raymond Wan <[EMAIL PROTECTED]>wrote:
>
> Hi Amit,
>
>
> Amit Saxena wrote:
>
>> On Thu, Nov 20, 2008 at 6:20 PM, Raymond Wan <[EMAIL PROTECTED]
>> >wrote:
>>
>>
>>> Hi Amit,
>>>
>>>
>>> Amit Saxena wrote:
>>>
>>>
>>>
Using external modules in the home directo
Hi Amit,
Amit Saxena wrote:
On Thu, Nov 20, 2008 at 6:20 PM, Raymond Wan <[EMAIL PROTECTED]>wrote:
Hi Amit,
Amit Saxena wrote:
Using external modules in the home directory is not disallowed, in fact I
keep using few CPAN modules from my home directory like PerlTidy etc.
However t
On Thu, Nov 20, 2008 at 6:20 PM, Raymond Wan <[EMAIL PROTECTED]>wrote:
>
> Hi Amit,
>
>
> Amit Saxena wrote:
>
>> Using external modules in the home directory is not disallowed, in fact I
>> keep using few CPAN modules from my home directory like PerlTidy etc.
>>
>> However the reason for which I
> Message du 20/11/08 13:39
> De : "Amit Saxena"
> A : "Raymond Wan"
> Copie à : "Perl Beginners" , "Amit Saxena"
> Objet : Re: How to determine the file type of a file passed as an input to
> the perl program ?
>
> If I don
Hi Amit,
Amit Saxena wrote:
Using external modules in the home directory is not disallowed, in fact I
keep using few CPAN modules from my home directory like PerlTidy etc.
However the reason for which I want to use an inbuilt module because I need
not ask sysadmin people to download and insta
On Thu, Nov 20, 2008 at 5:50 PM, Raymond Wan <[EMAIL PROTECTED]>wrote:
>
> Hi Amit,
>
>
> Amit Saxena wrote:
>
>> On Thu, Nov 20, 2008 at 4:59 PM, Raymond Wan <[EMAIL PROTECTED]
>> >wrote:
>>
>>
>>> Hi Amit,
>>>
>>>
Hi Amit,
Amit Saxena wrote:
On Thu, Nov 20, 2008 at 4:59 PM, Raymond Wan <[EMAIL PROTECTED]>wrote:
Hi Amit,
Amit Saxena wrote:
Hi all,
How to determine the file type of a file passed as an input to the perl
program ?
I want to have the same output as it's shown by &qu
On Thu, Nov 20, 2008 at 4:59 PM, Raymond Wan <[EMAIL PROTECTED]>wrote:
>
> Hi Amit,
>
> Amit Saxena wrote:
>
>> Hi all,
>>
>> How to determine the file type of a file passed as an input to the perl
>> program ?
>>
>> I want to hav
Hi Amit,
Amit Saxena wrote:
Hi all,
How to determine the file type of a file passed as an input to the perl
program ?
I want to have the same output as it's shown by "file" command in UNIX.
Try going to CPAN and searching for it. For example,
http://search.cpan.org/se
Hi all,
How to determine the file type of a file passed as an input to the perl
program ?
I want to have the same output as it's shown by "file" command in UNIX.
Thanks & Regards,
Amit Saxena
Rajnikant <[EMAIL PROTECTED]> wrote:
> Thanks Thomas.
>
> I tried same with File::Type :).
I considered that module, too, but it's got some problems:
http://cpanratings.perl.org/dist/File-Type
While I don't mind the memory footprint, I would rather have
a module that u
Thanks Thomas.
I tried same with File::Type :).
-Original Message-
From: Thomas Bätzler [mailto:[EMAIL PROTECTED]
Sent: Monday, July 07, 2008 4:25 PM
To: Perl Beginners
Cc: Rajnikant
Subject: RE: Getting file type in perl
Rajnikant <[EMAIL PROTECTED]> asked:
> Unix command f
Rajnikant <[EMAIL PROTECTED]> asked:
> Unix command file gives file type of that file.
> # file a.txt.gz
> a.txt.gz: gzip compressed data, was "a.txt", from Unix
>
> How can I achieve same in perl?
Using a module like
http://search.cpan.org/~pardus/File-MimeInfo-
Hello everyone,
Unix command file gives file type of that file.
# file a.txt.gz
a.txt.gz: gzip compressed data, was "a.txt", from Unix
How can I achieve same in perl?
Thanks,
Rajnikant
DISCLAIMER
==
This e-mail may contain privileged and confidential information wh
I think the CGI.pm uploadinfo() is what I am looking for.
To answer Gunnar's question: I want to make sure I know the file type I am
dealing with so that I don't try to use print to write binary data to an
open file handle. When I wrote my first program 4 years ago, I thought I
could
On Dec 19, 2007 7:01 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote:
snip
> I did not install it yet so I can't check but I think you have it
> wrong. According to the docs you point to
>
>@ARGV ~~ /\.mdb\z/
>
> is equivalent to
>
>grep /\.mdb\z/, @ARGV
>
> which is true whenever at least one
From: "Chas. Owens" <[EMAIL PROTECTED]>
> On Dec 18, 2007 4:49 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
> snip
> > if (grep { not /\.mdb\z/ } @ARGV) {
> >print "All parameters must be MDB files\n";
> >exit;
> > }
> snip
>
> Or in Perl 5.10, coming to stores near you soon*, you can use the
On Dec 18, 2007 4:49 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
snip
> if (grep { not /\.mdb\z/ } @ARGV) {
>print "All parameters must be MDB files\n";
>exit;
> }
snip
Or in Perl 5.10, coming to stores near you soon*, you can use the
smart match operator:
@ARGV ~~ /\.mdb\z/
or die "All
goldtech wrote:
Hi,
If I have:
...
foreach (@ARGV) {
print "do something only to .mdb files";
}
I could use File::Basename's fileparse and test for the file extension
and put a big if statement around or in the foreach loop. So if a user
puts a non .mdb file argument on the cmd line it won
On Dec 18, 2007 10:08 PM, goldtech <[EMAIL PROTECTED]> wrote:
> Hi,
>
> If I have:
>
> ...
> foreach (@ARGV) {
>print "do something only to .mdb files";
> }
>
> I could use File::Basename's fileparse and test for the file extension
> and put a big if statement around or in the foreach loop. So
Hi,
If I have:
...
foreach (@ARGV) {
print "do something only to .mdb files";
}
I could use File::Basename's fileparse and test for the file extension
and put a big if statement around or in the foreach loop. So if a user
puts a non .mdb file argument on the cmd line it won't process and
pri
Xuer wrote:
>
> Can I get the file type info from the result list of lstat?
> such as if it's a dir( as -d), or a slink( as -s) ...etc.
> how to ?
-s is for a socket, -l is for a symbolic link.
The complete details are in the stat entry of perlfunc.pod.
perldoc -f stat
Can I get the file type info from the result list of lstat?
such as if it's a dir( as -d), or a slink( as -s) ...etc.
how to ?
thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
30 matches
Mail list logo