Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
iwregen return code
Vibha
Hi
I am using iwregen to regenerate all htmls in the site. I am looping through the list of htmls and I do an iwregen on each html. I need to know the return code of iwregen to find out if it actually regenrated the html file or not. I do not want to go by the timestamp difference of the file. Is there any other way to find if the file has been regenerated?
Am using Teamsite v6.5 on Solaris
Thanks
Vibha
Find more posts tagged with
Comments
Adam Stoller
Trial and error will tell you whether the code was written correctly.
If you run it with improper arguments - you should get an exit status / return code of non-zero
If you run it with proper arguments in a place where you do not have the ability to write the output file (or read one of the input files) - you should get an exit status / return code of non-zero.
If you run it with proper arguments in a place where you do have the ability to write the output file and you do have the ability to read all of the input files - you should get an exit status / return code of zero.
Now - the tricky part - if you do the last test several times in a row - where you can verify that the output file is NOT getting overwritten each time (because nothing has changed and iwregen tries to be "smart" about this) - does the CLT exit with a status of zero or non-zero?
One could argue it either way - but if it's non-zero it should be a distinct non-zero value from the other non-zero values so that you can recognize and ignore it.
If it exits with a zero status than your only true test is the timestamp on the file and/or whether the file is modified as a result of the running. The last might be easier. You can run iwfilestate on the vpath of the output file to verify if the file is modified or not (play with the CLT - it's not difficult to use)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com