Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 taking refuge in the Monastery: (5)
As of 2014-08-20 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls