Kinook Software Forum

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

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-28-2006, 09:07 AM
ftrocchia ftrocchia is online now
Registered User
 
Join Date: 04-28-2006
Posts: 4
Text file to log

Hi.

What I am trying to do is copy the contents of a text file into the build log. We have a third party process that generates a text file, and I need it to be in the log.

Any suggestions?

Thanks!
Reply With Quote
  #2  
Old 04-28-2006, 10:22 AM
modernrocketry modernrocketry is online now
Registered User
 
Join Date: 04-06-2006
Posts: 19
Couple of thoughts:
1. Use the DOS command type in a build step
for example: type myfile.txt

2. Use a VBscript to output to the build log
for example:
in a "Run Script" step use VBscript to output each line using Builder.LogMessage

Perhaps the mighty Kinook Admin will have a better suggestion.
Reply With Quote
  #3  
Old 04-28-2006, 10:39 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
If you're calling the third party process from a Run Program step, choose 'A file' on the Program tab and enter the filename there.

Or

1) Use a script expression like this in a Log Message action:
[vbld_GetFileContents("c:\path\to\file.ext")]

or

[vbld_GetFileContents("%FILE_TO_READ%")]

(if the filename is in macro). Demonstrated in the XML.bld, Advanced.bld, and Script.bld samples.

http://www.visualbuild.com/Manual/scriptexpressions.htm
http://www.visualbuild.com/Manual/sysscriptfile.htm

2) From a Run Script action:

Builder.LogMessage vbld_GetFileContents("c:\path\to\file.ext")

3) From a Run Program action:

%DOSCMD% type "c:\path\to\file.ext"
Reply With Quote
  #4  
Old 04-28-2006, 11:40 AM
ftrocchia ftrocchia is online now
Registered User
 
Join Date: 04-28-2006
Posts: 4
Thanks! Worked like a charm.

My next questions is related to the log file. Is there a way to clear the log file?

In my build process I am building, then sending the log in an email. After this I need to continue building and sending a different email. I don't want the first part to be in the log that is sent for the second part.
Reply With Quote
  #5  
Old 04-28-2006, 02:14 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
If you're using text logging format, just delete the file. For instance, in a Run Program step:

%DOSCMD% del "%LOGFILE%"

For XML format, that won't work since it won't be a valid XML file if you delete it mid-build. You may want to put the 2nd part of the build in a separate project (which uses a different log file) and call from the first with a VisBuildPro Project action.
Reply With Quote
  #6  
Old 05-01-2006, 12:40 PM
ftrocchia ftrocchia is online now
Registered User
 
Join Date: 04-28-2006
Posts: 4
I've started using the delete command mentioned in the previous post, and it seems to be working for the most part.

The problem I am having is that it appears the file didn't get deleted, it is just being overwritten.

The third step in my process is shorter, so when I look at the logs I am seeing the third step logging, and then it ends, and then I see the rest of the 2nd step.
Reply With Quote
  #7  
Old 05-16-2006, 08:12 AM
ftrocchia ftrocchia is online now
Registered User
 
Join Date: 04-28-2006
Posts: 4
bump
Reply With Quote
  #8  
Old 05-16-2006, 01:10 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
It's not clear to me exactly what you mean. Please ZIP and post or send:
1) The info from Help | About | Install Info
2) A reproducible test case -- .bld file(s) that reproduce the problem and can be built here
3) A detailed description of the behavior you get vs. the expected behavior

Thanks.
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.