SPUG: Win32 Sorting directory by date
Jeremy Devenport
jeremy at weezel.com
Wed Oct 3 00:14:27 CDT 2001
This is covered in Effective Perl Programming. The recipe is at
http://www.effectiveperl.com/recipes/sorting.html "Sorting filenames by
modification time". For extra fun and adventure you can increase the
speed of the sort by adding in a Schwartzian Transform, see the next
recipe down.
Jeremy
-----Original Message-----
From: owner-spug-list at pm.org [mailto:owner-spug-list at pm.org] On Behalf
Of Bryan Dees
Sent: Tuesday, October 02, 2001 5:53 PM
To: Spug-List (E-mail)
Subject: SPUG: Win32 Sorting directory by date
Hello, I'm trying to sort by date under Windows NT but not having much
luck.
What I want to do is open the directory, sort the array by their touch
date and time then print out the contents. I've messed
around with a couple mods (polysort, file::sort, etc.) but they still
wont sort by the actual file touch date
and time. I also tryed redirecting the opendir var through dir /od for
example:
opendir(FH, "c:\\winnt\\system32\\cmd.exe \/c dir \/od $Files |")
But perl didn't like that either.
Any ideas?
Thank You,
Bryan Dees
Distributed Systems Analyst
Airborne Express
bryan.dees at airborne.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your
Email-address
For daily traffic, use spug-list for LIST ; for weekly,
spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/
More information about the spug-list
mailing list