ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurence Mills-Gahl <elem...@gmail.com>
Subject Re: Output of perl exec behaving oddly
Date Mon, 24 Jan 2011 15:41:19 GMT
I wasn't looking at the ${BUILDTIME} property because I was assuming
that wouldn't change during the run, but it is (I noticed the output
directory created ended with 20110124103046 (the timestamp) and the
second invocation of compile_patients_on_alert was trying to write a
file to 20110124103052. So your initial comment on immutability of
properties was helpful because I was assuming  ${BUILDTIME} would not
change (and it did... yikes!)

Hmmmm... I'm going to have to look at the foreach task to see if it
creates an entirely new ant invocation with each iteration... that would
be the easy way to allow properties to change and it would explain why
the timestamp (that is only set in the top of the project) appears to
change when it shouldn't... hmmm. That would also explain the apparent
inconsistency in that if the execs were spawned quickly enough (when I
was trying spawn="yes" ) they might get into the same timestamped
directory, but then eventually, one wouldn't).

Hmmm... time to dig in to the foreach environment a bit.

Thanks for looking at this.

Larry

On 1/24/11 8:25 AM, Michael Ludwig wrote:
> Laurence Mills-Gahl schrieb am 24.01.2011 um 00:56 (-0500):
>> On 1/23/11 10:12 PM, Michael Ludwig wrote:
>>> Laurence Mills-Gahl schrieb am 23.01.2011 um 21:27 (-0500):
>>>> I have a list of centerid's and a "foreach" loop
>>> Red flag goes up …
>> What is the red flag?
> Ah, that was just a manner of speaking.
>
> I was on the wrong track, sorry. :-)
>
>> The foreach task (from Ant-Contrib) passes a parameter to the target
>> task. The ${centerid} is echoed on the target of the loop and it is
>> indeed changing as I would expect it to...
> Good - I had overlooked that possibility.
>
>> The script and commandline args are all correct and produce the
>> correct result when called from the shell.
>> The problem is that calling this from ant produces *inconsistent*
>> results. Some of the first report files are written but after two or
>> three iterations, the output that should be going to the file is
>> turning up in standard output.
>> The -d switch does provide lots of detail about what is going on at
>> each step and I don't see anything unexpected that would make the
>> output of an (apparently) separate process (the perl process) which is
>> outside the ant execution space, change from a perl file handle to
>> standard out.
> Another idea, but off-topic for Ant:
>
> Are you doing proper error checking on calls to open() in your Perl
> code?
>
>   open my $fh, '>', $fn or die "open $fn: $!"; # error checking
>
>> Thanks for your help, but I'm still on the hunt for why this is
>> happening.
> Good luck - someone else might have better ideas!
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message