Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: List Contents of Windows Directory Folder

by karlgoethebier (Prior)
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»

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007154]
[Tanktalus]: great, now I'm going to have to convert html codes to text for display... :)
[choroba]: Can you steal the code from pm-cb-g?
[Tanktalus]: maybe next week at the earliest. :P
[Tux]: Don't you ♥ Unicode :)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2017-09-25 21:20 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (291 votes). Check out past polls.