Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-06-2003, 09:49 PM
sigh71 sigh71 is online now
Registered User
 
Join Date: 02-06-2003
Posts: 7
Copy Files action

Is it possible to make the copy files action fail if one of the files
listed to be copied isn't found? or do i have to use the vbscript filecopy function and check its return value?
Reply With Quote
  #2  
Old 03-06-2003, 09:49 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
No. One option would be, before copying, to add a step that conditionally builds (and fails) if the file doesn't exist. For instance, a Run Program step with a command of 'File xyz does not exist', and a conditional build rule of '[vbld_FSO.FileExists("xyz")]' equal to 0. Or you could use a Run Program step of %DOSCMD% copy xyz <dest> on the individual file, and it will fail if the file doesn't exist.
Reply With Quote
  #3  
Old 05-05-2003, 06:27 PM
Marc Marc is online now
Registered User
 
Join Date: 05-05-2003
Posts: 1
Does Kinook intend to fix this 'feature' any time soon?
Reply With Quote
  #4  
Old 04-30-2012, 02:28 AM
raistlin raistlin is online now
Registered User
 
Join Date: 11-14-2008
Posts: 23
I think an option like "Fail build when one or more files are not found." to this step would really help.

I guess this is not quite possible because this step supports wildcard. So it is not able to do a proper counting.
Reply With Quote
  #5  
Old 04-30-2012, 06:28 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
If you're doing a non-incremental, non-recursive copy, aren't excluding any files, and the files listed to be copied are all filenames and not wildcards or folders, you could use script code like this in the step's vbld_StepDone script event to fail if the copy count doesn't match the filename count:

Code:
Sub vbld_StepDone()
  ' fail the step if the number of files to be included does not match the number of files copied
  If UBound(Split(Step.Property("Ext"), vbCrLf))+1 <> vbld_TempMacros()("COPYFILES_COPY_COUNT") Then
    Builder.LogMessage2 "Number of copied files does not match list of files to copy", vbldLogLevelError
    Step.BuildStatus = vbldStepStatFailed
  End If
End Sub
http://www.kinook.com/VisBuildPro/Ma...riptevents.htm
http://www.kinook.com/VisBuildPro/Ma...ilesaction.htm
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 02:02 AM.


Copyright © 1999-2023 Kinook Software, Inc.