Page 1 of 1 1
Topic Options
#180886 - 2007-09-27 12:23 AM directory/folder content by date
ledzepe Offline
Fresh Scripter

Registered: 2005-12-06
Posts: 26
I've got a directory/folder on our server that has about 10,000 or more pictures. More are added everyday. Is there a way to extract those files by date? Say if I want to get only those files dated May 15, 2007. Can kix read the date stamp directly?
Top
#180887 - 2007-09-27 12:41 AM Re: directory/folder content by date [Re: ledzepe]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
Simplest way is to use DIRPlus: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=82153

This simple fragment will list all the files in a directory and the modified date to go along with it.

 Code:
break on
for each $file in dirplus(@scriptdir)
  ? $file + " " + split($file.DateLastModified," ")[0]
next


See if this will get you going.
_________________________
(... better days ahead)

Top
#181398 - 2007-10-09 07:37 PM Re: directory/folder content by date [Re: Allen]
ledzepe Offline
Fresh Scripter

Registered: 2005-12-06
Posts: 26
this is good! now is there a way to just display the filename and date?

right now it comes out as:
C:\DOCS\DATA\IMPT\P00123456.doc 10/02/2007
C:\DOCS\DATA\IMPT102007\R00987654.doc 10/02/2007
C:\DOCS\DATA\S01212120.doc 10/02/2007

i need it to come like below because there are 50 different subfolders:
P00123456.doc 10/02/2007
R00987654.doc 10/02/2007
S01212120.doc 10/02/2007

my objective is to get the filename created based on the date that i specify. Thanks

Top
#181399 - 2007-10-09 07:40 PM Re: directory/folder content by date [Re: ledzepe]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
change
$file
to:
Substr($file,InStrRev($file,"\")+1)

or just to:
$file.name


Edited by DrillSergeant (2007-10-09 07:45 PM)
Edit Reason: didn't know that dirplus returned full objects
_________________________
The Code is out there

Top
#181401 - 2007-10-09 07:42 PM Re: directory/folder content by date [Re: ledzepe]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
Try $file.name
_________________________
(... better days ahead)

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 641 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.057 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org