WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

FileDelete Error 1016 when File Does Not Exist


If you are in directory A, and you do FileExist("somefile.ext"), where somefile.ext is not in the current directory, but is somewhere on the PATH, then the function returns 1 (true). So far, so good. However, if, under the same conditions, you do a FileDelete("somefile.ext"), this throws a fatal error 1016.

Note that if you do: FileDelete("AFileNotThatDoesNotExistButIsNot.ONpath"), it calmly returns 1 and throws no error.

It seems as if FileDelete does a PATH search for the file (a la FileExist), and that part returns true, but then tries to delete it and the delete fails.

Background:
WinBatch 2004A

Answer:

Looks like there has been this wierd bug in FileDelete for approximately 5 years or so when when the function did the "pre check" to verify the file actually existed ,it did a FileExist kind of search and looked deeper than it should for the file. And it found it. Then when the the delete came..it could no longer locate the file (doing a proper lookup of the file)

Will be fixed starting in version 2004B

Workaround

Instead of:

;no file path specified
FileDelete("wwwbatch.ini")
Use:
;Specify full file path
FileDelete(strcat(DirGet(),"wwwbatch.ini"))

Article ID:   W16444
File Created: 2005:02:18:12:20:44
Last Updated: 2005:02:18:12:20:44