Posted: Sun Apr 21, 2002 6:33 pm
Restored from previous forum. Originally posted by freak.
Hi all,
The following code should scan drive c and write the Directory tree to the File
c:\scan.log, but it always crashes on a certain Directory.
Is there someting wrong in this code? Can someone help me?
Timo
A debugged program is one for which you have not yet found the conditions that make it fail.
Hi all,
The following code should scan drive c and write the Directory tree to the File
c:\scan.log, but it always crashes on a certain Directory.
Is there someting wrong in this code? Can someone help me?
Code: Select all
; ++++++++++++++++++++++++++++++++++++++++++
Procedure SearchDisk(path.s)
WriteStringN(path)
name.s = path + "*"
handle.l = FindFirstFile_(name, info.WIN32_FIND_DATA)
If handle #INVALID_HANDLE_VALUE
Repeat
Entry.s = PeekS(@info\cFileName[0])
If info\dwFileAttributes & #FILE_ATTRIBUTE_DIRECTORY
If Entry "." And Entry ".."
SearchDisk(path + Entry + "\")
EndIf
EndIf
Until FindNextFile_(handle, info)= #FALSE
FindClose_(handle)
EndIf
EndProcedure
CreateFile(0, "c:\scan.log")
SearchDisk("C:\")
CloseFile(0)
; ++++++++++++++++++++++++++++++++++++++++++
A debugged program is one for which you have not yet found the conditions that make it fail.