In a CMD batch trigger script I use a cleartool
command to write activity information to a file:
cleartool lsactivity -long %CLEARCASE_ACTIVITY%>>C:\folder\activityinfo.txt
This works almost every time but occasionally for a reason unknown to me the cleartool command does not write the information correctly to file resulting in a 0KB output file that I cannot delete. Whatsmore it blocks the trigger from running properly in successive attempts.
I wrote some code that checks to see whether the output file is 0KB in size but that doesn't work because the cleartool command seems to keep the file open even though it isn't writing to it. It's so strange!
After a number of hours the trigger works again because I assume the locked process unlocks.
Is there any way to avoid this phenomenon?
Regards,
Andrew