FileCopy error

Started by Mogens Christensen, April 20, 2018, 01:51:20 AM

Previous topic - Next topic

Mogens Christensen

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

td

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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

mpiaser

how about using if fileexist()

td

FileExist does not accept file masks. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade