Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: List Contents of Windows Directory Folder

by karlgoethebier (Curate)
on Dec 04, 2012 at 21:06 UTC ( #1007154=note: print w/ replies, xml ) Need Help??


in reply to List Contents of Windows Directory Folder

With "type" you mean the suffix of the file(s), right? Here is another small solution that might do the job. Give it a try. It should be easy to order the output according to your needs. Some illuminated brothers provided already some links for further reading/diving deeper a.s.o.

#!c:/perl/bin/perl.exe + use strict; use warnings; use IO::All; use File::Basename; my ( $in, $out, $io_objects, @line ); ( $in, $out ) = @ARGV; @io_objects = io($in)->all; for my $io_object (@io_objects) { if ( $io_object->type eq 'file' ) { @line = ( $io_object->name, ( $io_object->stat )[7], ( $io_object->stat )[9], ( fileparse( $io_object, qr/\.[^.]*/ ) )[2], ); } join( "\t", @line ) . qq(\n) >> io($out); } __END__

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»


Comment on Re: List Contents of Windows Directory Folder
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007154]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-09-18 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (104 votes), past polls