deleting a file
Posted: Sun Nov 14, 2004 12:37 am
I am trying to delete all files in a specific directory.
I placed a debug code to tell me if the delte process fails, and for some reason... I can not delete any of the files
Here is my code (only the applicable part):
the debug Filename$ is returning the proper file name in the directory. But The debug "cant delete" comes up for every file name. In other words, no files in this history directory are being deleted and I want to delete all of them if the user confirms that he/she wants to delete their "history"
Thanks in advance
I placed a debug code to tell me if the delte process fails, and for some reason... I can not delete any of the files

Here is my code (only the applicable part):
Code: Select all
#HistoryDir.s = "history\" ;history directory
#HistoryExt.s = ".hx" ;history extension
ExamineDirectory(#PB_Any, #HistoryDir, "*"+#HistoryExt)
Repeat
FileType = NextDirectoryEntry()
If FileType = 1
FileName$ = DirectoryEntryName()
Debug(FileName$)
If DeleteFile(FileName$)=0:Debug "cant delete":EndIf
EndIf
Until FileType = 0
Thanks in advance