Re: file type

2016-08-25 Thread hw
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,

Re: file type

2016-08-24 Thread David Mertens
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

file type

2016-08-23 Thread hw
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

Re: File Type

2010-04-13 Thread Parag Kalra
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? &

File Type

2010-04-13 Thread Arun P Menon
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

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread John W. Krahn
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

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Chas. Owens
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

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Amit Saxena
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

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Raymond Wan
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

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Amit Saxena
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

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Jeff Pang
> 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&#

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Raymond Wan
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

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Amit Saxena
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, >>> >>>

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Raymond Wan
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

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Amit Saxena
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

Re: How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Raymond Wan
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

How to determine the file type of a file passed as an input to the perl program ?

2008-11-20 Thread Amit Saxena
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

RE: Getting file type in perl

2008-07-07 Thread Thomas Bätzler
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

RE: Getting file type in perl

2008-07-07 Thread Rajnikant
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

RE: Getting file type in perl

2008-07-07 Thread Thomas Bätzler
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-

Getting file type in perl

2008-07-07 Thread Rajnikant
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

Re: Determine upload file type

2008-06-23 Thread Mimi Cafe
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

Re: testing for a file type

2007-12-20 Thread Chas. Owens
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

Re: testing for a file type

2007-12-19 Thread Jenda Krynicky
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

Re: testing for a file type

2007-12-19 Thread Chas. Owens
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

Re: testing for a file type

2007-12-18 Thread Rob Dixon
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

Re: testing for a file type

2007-12-18 Thread Ankur Gupta
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

testing for a file type

2007-12-18 Thread goldtech
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

Re: get file type info from lstat?

2004-03-14 Thread John W. Krahn
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

get file type info from lstat?

2004-03-13 Thread Xuer
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>