You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@bost.de> on 2000/06/27 13:39:31 UTC

Touch task

Hi,

Some of you might have noticed my hack to Untar to set the file
modification times to the values retrieved from the tar file. I'd like
to do the same to the Expand task. As I don't want to duplicate code
I'm going to move the relevant parts out into another class which
could easily be a Touch task.

The problem I see is that this task wouldn't do anything in JDK 1.1 as
File.setLastModified hasn't been there and write(new byte[0]) doesn't
change the modification time of the file you are writing to - at least
not on my Linux box.

So my question is whether we want to have a touch task that would be a
NOP on JDK 1.1 - except when the file that shall be touched doesn't
exist.

Stefan

RE: Touch task

Posted by Conor MacNeill <co...@m64.com>.
Stefan,

> >>>>> "CM" == Conor MacNeill <co...@m64.com> writes:
>
>  CM> I think a NOP would be misleading. I would prefer to see it
>  CM> blowup.
>
> Do you think a warning message would be close enough to "blowup" or
> would you prefer it to throw a BuildException?
>

I had in mind an exception but I guess a warning is OK - it allows the same
build file to be used on all VMs.

Conor


Re: Touch task

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "CM" == Conor MacNeill <co...@m64.com> writes:

 CM> I think a NOP would be misleading. I would prefer to see it
 CM> blowup.

Do you think a warning message would be close enough to "blowup" or
would you prefer it to throw a BuildException?

Stefan

Re: Touch task

Posted by James Duncan Davidson <ja...@eng.sun.com>.
on 6/27/00 5:56 AM, Conor MacNeill at conor@m64.com wrote:

> I think a NOP would be misleading. I would prefer to see it blowup.
> Something like
> "touch is not supported under Java 1.1". No surprises then (look how many
> times the
> modern compile thing has caught people out).

Doesn't sound unreasonable.. Therefore it gets used only where projects are
assuming 1.2+.

.duncan


RE: Touch task

Posted by Conor MacNeill <co...@m64.com>.
> From: Stefan Bodewig [mailto:bodewig@bost.de]
> Sent: Tuesday, 27 June 2000 21:40
> To: ant-dev@jakarta.apache.org
> Subject: Touch task
>
>
> Hi,
>
> Some of you might have noticed my hack to Untar to set the file
> modification times to the values retrieved from the tar file. I'd like
> to do the same to the Expand task. As I don't want to duplicate code
> I'm going to move the relevant parts out into another class which
> could easily be a Touch task.
>
> The problem I see is that this task wouldn't do anything in JDK 1.1 as
> File.setLastModified hasn't been there and write(new byte[0]) doesn't
> change the modification time of the file you are writing to - at least
> not on my Linux box.
>
> So my question is whether we want to have a touch task that would be a
> NOP on JDK 1.1 - except when the file that shall be touched doesn't
> exist.
>

I think a NOP would be misleading. I would prefer to see it blowup.
Something like
"touch is not supported under Java 1.1". No surprises then (look how many
times the
modern compile thing has caught people out).

Conor


Re: Touch task

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "BP" == Brill Pappin <jo...@jmonkey.com> writes:

 BP> I think its worth putting it in, particularly since its not hard
 BP> to do

I'm going to write this class anyway, the question was wether I should
make it a task or not.

Thanks 

        Stefan


RE: Touch task

Posted by Brill Pappin <jo...@jmonkey.com>.
I think its worth putting it in, particularly since its not hard to do...
and  people are slowly moving to JDK 1.3 etc...

- Brill Pappin

> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@bost.de]
> Sent: June 27, 2000 7:40 AM
> To: ant-dev@jakarta.apache.org
> Subject: Touch task
>
>
> Hi,
>
> Some of you might have noticed my hack to Untar to set the file
> modification times to the values retrieved from the tar file. I'd like
> to do the same to the Expand task. As I don't want to duplicate code
> I'm going to move the relevant parts out into another class which
> could easily be a Touch task.
>
> The problem I see is that this task wouldn't do anything in JDK 1.1 as
> File.setLastModified hasn't been there and write(new byte[0]) doesn't
> change the modification time of the file you are writing to - at least
> not on my Linux box.
>
> So my question is whether we want to have a touch task that would be a
> NOP on JDK 1.1 - except when the file that shall be touched doesn't
> exist.
>
> Stefan