You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Daniel Barclay <Da...@digitalfocus.com> on 2001/05/08 21:02:23 UTC

How to use UpToDate with absolute source file name (not patterns)

Can the "uptodate" task be used with an absolute file pathname for a
source file?

(I think) I want to something like this:

    <uptodate property="isUpToDate" targetfile=".flagfile" >
      <srcfiles dir=".">
        <include name="${sourceFile}" />
      </srcfiles>
    </uptodate>

If property sourceFile is a relative name, the name works as a file 
pattern, and everything works.

However, if sourceFile is an absolute pathname (on Windows, so 
starting with "C:/..."), the uptodate task doesn't work.  (It
always thinks the target file is up to date.)  


Can the uptodate task be used with absolute pathnames?

Thanks,
Daniel
-- 
Daniel Barclay
Digital Focus
Daniel.Barclay@digitalfocus.com

Re: How to use UpToDate with absolute source file name (not patterns)

Posted by Daniel Barclay <Da...@digitalfocus.com>.
Diane Holt wrote:
> 
> --- Daniel Barclay <Da...@digitalfocus.com> wrote:
> > Can the "uptodate" task be used with an absolute file pathname for a
> > source file?
> >
> > (I think) I want to something like this:
> >
> >     <uptodate property="isUpToDate" targetfile=".flagfile" >
> >       <srcfiles dir=".">
> >         <include name="${sourceFile}" />
> >       </srcfiles>
> >     </uptodate>
> >
> > If property sourceFile is a relative name, the name works as a file
> > pattern, and everything works.
> >
> > However, if sourceFile is an absolute pathname (on Windows, so
> > starting with "C:/..."), the uptodate task doesn't work.  (It
> > always thinks the target file is up to date.)
> >
> > Can the uptodate task be used with absolute pathnames?
> 
> Try setting the "dir" attribute of <srcfiles> to the full-path leading up
> to the file, then specify the filename for the <include> (or "includes").

But that solution would require splitting my sourceFile property into two 
parts just to refer to my file.  That's gross (having to change that much
just to refer to the file).

Is there any other way to pass a filename to the uptodate task?

If not, then there's a design bug (a feature limitation) here.  (There 
should be a way to specify a file by absolute name.)


Daniel
-- 
Daniel Barclay
Digital Focus
Daniel.Barclay@digitalfocus.com

Re: How to use UpToDate with absolute source file name (not patterns)

Posted by Diane Holt <ho...@yahoo.com>.
--- Daniel Barclay <Da...@digitalfocus.com> wrote:
> Can the "uptodate" task be used with an absolute file pathname for a
> source file?
> 
> (I think) I want to something like this:
> 
>     <uptodate property="isUpToDate" targetfile=".flagfile" >
>       <srcfiles dir=".">
>         <include name="${sourceFile}" />
>       </srcfiles>
>     </uptodate>
> 
> If property sourceFile is a relative name, the name works as a file 
> pattern, and everything works.
> 
> However, if sourceFile is an absolute pathname (on Windows, so 
> starting with "C:/..."), the uptodate task doesn't work.  (It
> always thinks the target file is up to date.)  
>  
> Can the uptodate task be used with absolute pathnames?

Try setting the "dir" attribute of <srcfiles> to the full-path leading up
to the file, then specify the filename for the <include> (or "includes").

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/