WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: Mogens Christensen on April 20, 2018, 01:51:20 AM

Title: FileCopy error
Post by: Mogens Christensen on April 20, 2018, 01:51:20 AM
Hi all

How can i avoid this error when there is no files with this name es*.xml in the libaray


errorMode(@OFF)

rc = FileCopy("\\topdanmark\datadfs\apppermanent\KADMRBatchprod\034\splitter\inkopi\es*.xml","\\topdanmark\datadfs\apppermanent\KADMRBatchprod\034\in\",@FALSE)
(65813) GOSUB Error handler

WIL ERROR SUPPRESSED =>1002 (File List Processing - No Match)

THANKS
Title: Re: FileCopy error
Post by: td on April 20, 2018, 06:45:39 AM
It looks like you already have using the "ErrorMode" function based on your debug trace file snipet.  Are you say that you would prefer to check for the presence of file and not execute file copy when no files exist?   If that is the case you can use the "FileItemize" with the appropriate mask to determine if any files are present.
Title: Re: FileCopy error
Post by: mpiaser on May 01, 2018, 02:33:38 PM
how about using if fileexist()
Title: Re: FileCopy error
Post by: td on May 02, 2018, 07:13:32 AM
FileExist does not accept file masks. 
Title: Re: FileCopy error
Post by: td on May 02, 2018, 01:46:53 PM
If you go to the FileExist documentation in the Consolidated WIL Help file you will find an example that demonstrates a very simple way to use FileItemize instead of FileExist to check for the existence of files using a file mask.