Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-26-2006, 02:29 PM
DavidMacLean DavidMacLean is online now
Registered User
 
Join Date: 12-28-2005
Posts: 19
Checking for file delete/create results

Building project step 'Create Release directory'...
A subdirectory or file C:\Foo\Bar already exists.

Building project step 'Empty output directory'...
File C:\Foo\Bar\*.BPL' does not exists


The above results using a RUN PROGRAM action, eg

%DOSCMD% CALL DEL %RELEASEDIR%\*.BPL


It is not an error if the file to be deleted is already deleted. Similarly, it is not an error if the directory to be created already exists.

Yet if I shut off "fail on errors", what happens when there is a real error?

Any advice...? Please and thank you.
Reply With Quote
  #2  
Old 01-26-2006, 03:48 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
For the create case, conditionally build the step only if the folder doesn't exist. See the Create dest dir step of the Recurse.bld sample.

In the delete case, testing here on Windows XP SP2 (with %DOSCMD% resolving to C:\WINDOWS\system32\cmd.exe /C), that command does return a 0 (success) exit code if no matching files are found, but if it does something different in your environment, you could treat a failure with output containing 'does not exist' as success by adding (VBScript) code like this to the step's vbld_StepDone script event function:

If InStr(Application.ExpandMacros("%LASTSTEP_OUTPUT%" ), "does not exist") Then
Step.BuildStatus = vbldStepStatSucceeded
End If

See help on script events for more details: http://www.visualbuild.com/Manual/?scriptevents.htm
Reply With Quote
  #3  
Old 01-27-2006, 12:04 PM
DavidMacLean DavidMacLean is online now
Registered User
 
Join Date: 12-28-2005
Posts: 19
Thank you for a prompt and helpful reply
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 10:09 AM.


Copyright © 1999-2023 Kinook Software, Inc.