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

Error Codes

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

1003 FileMove failed


Question:

General Error Trap question on the FileMove command. I have a routine that checks the validity of some Zip files using the Zip Extender. If they are OK, we process, if not, I move them to a hold directory to work on later. 98% of the time, it works. Every once in a while, of course at 2:00 AM when no one is watching, I'll get an Error 1003. Could someone tell me what this error is so I can trap it and not stop the script?

Answer:

Most likely I would suspect the file you are trying to move is still in use by the application that is creating it and that application was not ready to let go of it.

If some other process is moving files into a directory, just because a file exists in a directory does not mean it is complete and ready for processing by a different program.

On my processes that do something like that, first I assume I will never have to work with a zero byte file. Then after I get the file name, before I process it I check the file size with the FileSize function (and NOT the FileSizeEX function). If the FileSize function reports 0 then the file is not yet ready for processing. So, depending on the program, I either wait a few seconds then check again, or skip the file until the next pass sometime later.

Finally, I recommend adding some code to check that the destination file does not already exist, and if it does make sure its not in-use (FileExist will return 2 if in-use), then delete it (FileDelete).


Article ID:   W15941
File Created: 2004:03:30:15:41:48
Last Updated: 2004:03:30:15:41:48