Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DeleteFile function

Status
Not open for further replies.

Johnsonit

Programmer
Nov 27, 2001
6
0
0
ZA
I have a procedure that needs to delete listed files. I use the Deletefile function to delete the files listed in a TStringList. Now I've come across a problem that not all files are deleted. Files that are in a web/internet folder (e.g. folders created by MS Frontpage) are not deleted. With the CopyFile function the files are copied. Why could this be? What makes these folders and files different than the other? What can I use to make sure that all files in the list are deleted?
 
hi,

The files are not different, but are probably opened before and not closed completly or in control by an other program. The copyfile will function but the DeleteFile function not.

Steph [Bigglasses]
 
Thanks, but I figured out the problem (while trying you advice)

The files in the web/internet folders are mainly read-only or archived files. The DeleteFile function do not delete the files with attributes. When setting the file attributes so that it is not read-only or archive of what ever, the DeleteFile function works!!!.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top