Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: List Contents of Windows Directory Folder

by karlgoethebier (Parson)
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]
[Lotus1]: you can't but you can request to have it deleted.
[Lotus1]: you can edit it as long as you were logged in when you submitted it

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2017-01-17 13:20 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (156 votes). Check out past polls.