viewpoint-particle

Author Topic: FileCopy error  (Read 424 times)

Mogens Christensen

  • Newbie
  • *
  • Posts: 10
FileCopy error
« 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

td

  • Tech Support
  • *****
  • Posts: 2595
    • WinBatch
Re: FileCopy error
« Reply #1 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.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


mpiaser

  • Newbie
  • *
  • Posts: 26
Re: FileCopy error
« Reply #2 on: May 01, 2018, 02:33:38 pm »
how about using if fileexist()

td

  • Tech Support
  • *****
  • Posts: 2595
    • WinBatch
Re: FileCopy error
« Reply #3 on: May 02, 2018, 07:13:32 am »
FileExist does not accept file masks. 
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


td

  • Tech Support
  • *****
  • Posts: 2595
    • WinBatch
Re: FileCopy error
« Reply #4 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.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates