Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link Par2: Procedure to get disk directory tree 1999-05-13 -- Chris Behling Here's the source procedure I use -- should work fine!! You would probably
define a que to keep all the HoldDir descriptions in -- could be Global or
passed into the procedure.
RecursiveDir(STRING WhichDir)
Local Data Embed:
FileQue QUEUE
name STRING(13)
date LONG
time LONG
size LONG
attrib BYTE !A bitmap, the same as the attributes
EQUATEs
END
HoldDir STRING(100)
Processed Code Embed:
! recursive routine that gets all directories
! get all of the directories
DIRECTORY(FileQue,CLIP(WhichDir) & '*.*',ff_:DIRECTORY) !Get
all files and directories
SORT(FileQue,+FileQue.name)
Recs# = RECORDS(FileQue)
LOOP a# = 1 TO Recs#
GET(FileQue,a#)
IF BAND(FileQue.attrib,ff_:DIRECTORY) AND FileQue.name <> '..' AND
FileQue.name <> '.'
! do your stuff here
!
!
! call dir routine again
HoldDir = CLIP(WhichDir) & CLIP(FileQue.name) & '\'
RecursiveDir(HoldDir)
END
END
Today is November 23, 2024, 3:26 am This article has been viewed 35323 times.
|
|