You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Patrick (Gus) Heck" <pa...@olin.edu> on 2002/05/30 22:46:11 UTC

[SUBMIT] symlink task

I have written a symlink task which should be useful for managing websites on unix or any other case where the symlinks in a directory may constitute valuable information. This task allows one to quickly and easily record the symlinks in an entire directory structure in a properties file. 

This makes it possible to have a directory that consists entirely of symlinks, and can be recreated without shell script and without typing in the links by hand.

The way I plan to use this is to record the links, and check the properties files into CVS. This way when cvs checks them out it creates the directories too. Then ant can come along and read the properties file making all the links I need.

I hope others will find this taks useful as well.

The symlink task highlights:
 - make a symlink
 - delete a symlink without deleting the target file/directory
 - record all the symlinks in a directory tree in a properties file
 - recreate the symlinks in a directory tree from the properties file
 - failonerror or not
 - overwrite existing symlinks or not.
 - symlink deletion method is exposed as a static utility function for use by developers
 - I have chosen not to expose the properites file creation method in this task but both it and the symlink deletetion method might be transportable to FileUtils.java (the method in the PropertyFile task that I mostly copied is private). I will let the commiters decide on this one however.

Code and Testcases compiled and run on sun jdk 1.4.0 and ibm jdk 1.1.8_v1 
under linux 2.4 kernel

Enjoy,
Gus



Re: [SUBMIT] symlink task

Posted by "Patrick (Gus) Heck" <pa...@olin.edu>.
So has anyone looked at this yet? I know people were pretty busy with the release of beta2, so now that that is done, what do you think?

 - Gus

"Patrick (Gus) Heck" wrote:

> I have written a symlink task which should be useful for managing websites on unix or any other case where the symlinks in a directory may constitute valuable information. This task allows one to quickly and easily record the symlinks in an entire directory structure in a properties file.
>
> This makes it possible to have a directory that consists entirely of symlinks, and can be recreated without shell script and without typing in the links by hand.
>
> The way I plan to use this is to record the links, and check the properties files into CVS. This way when cvs checks them out it creates the directories too. Then ant can come along and read the properties file making all the links I need.
>
> I hope others will find this taks useful as well.
>
> The symlink task highlights:
>  - make a symlink
>  - delete a symlink without deleting the target file/directory
>  - record all the symlinks in a directory tree in a properties file
>  - recreate the symlinks in a directory tree from the properties file
>  - failonerror or not
>  - overwrite existing symlinks or not.
>  - symlink deletion method is exposed as a static utility function for use by developers
>  - I have chosen not to expose the properites file creation method in this task but both it and the symlink deletetion method might be transportable to FileUtils.java (the method in the PropertyFile task that I mostly copied is private). I will let the commiters decide on this one however.
>
> Code and Testcases compiled and run on sun jdk 1.4.0 and ibm jdk 1.1.8_v1
> under linux 2.4 kernel
>
> Enjoy,
> Gus
>
>   ------------------------------------------------------------------------
>                      Name: symlink.tar.gz
>    symlink.tar.gz    Type: Unix Tape Archive (application/x-tar)
>                  Encoding: base64
>
>   ------------------------------------------------------------------------
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [SUBMIT] symlink task

Posted by "Patrick (Gus) Heck" <pa...@olin.edu>.
By the way, my task and the associated patch apply just fine to a
current checkout (not 1.5 branch) so really all it needs is a commit :).
It doesn't have to go in 1.5 to work anymore. I wish it could of course
:) but realize that it is not likely.

-Gus

"Patrick (Gus) Heck" wrote:
> 
> Oh I forgot to mention, I had to build it against 1.5b1 because bug 1550
> is not fixed in 1.6 branch. I expect that it will apply just fine there.
> I also made a small tweak to build.sh so that the tests run under 1.1
> where execute has problems finding ant.home with reletive paths. (my
> guess from looking at the problem is that this problem persists through
> all java before 1.3 but I havn't proven that.
> 
> Gus
> 
> Patrick (Gus) Heck wrote:
> 
> > I have written a symlink task which should be useful for managing
> > websites on unix or any other case where the symlinks in a directory
> > may constitute valuable information. This task allows one to quickly
> > and easily record the symlinks in an entire directory structure in a
> > properties file.
> > This makes it possible to have a directory that consists entirely of
> > symlinks, and can be recreated without shell script and without typing
> > in the links by hand.
> >
> > The way I plan to use this is to record the links, and check the
> > properties files into CVS. This way when cvs checks them out it
> > creates the directories too. Then ant can come along and read the
> > properties file making all the links I need.
> >
> > I hope others will find this taks useful as well.
> >
> > The symlink task highlights:
> > - make a symlink
> > - delete a symlink without deleting the target file/directory
> > - record all the symlinks in a directory tree in a properties file
> > - recreate the symlinks in a directory tree from the properties file
> > - failonerror or not
> > - overwrite existing symlinks or not.
> > - symlink deletion method is exposed as a static utility function for
> > use by developers
> > - I have chosen not to expose the properites file creation method in
> > this task but both it and the symlink deletetion method might be
> > transportable to FileUtils.java (the method in the PropertyFile task
> > that I mostly copied is private). I will let the commiters decide on
> > this one however.
> >
> > Code and Testcases compiled and run on sun jdk 1.4.0 and ibm jdk
> > 1.1.8_v1 under linux 2.4 kernel
> >
> > Enjoy,
> > Gus
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >--
> >To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [SUBMIT] symlink task

Posted by "Patrick (Gus) Heck" <pa...@olin.edu>.
Oh I forgot to mention, I had to build it against 1.5b1 because bug 1550 
is not fixed in 1.6 branch. I expect that it will apply just fine there. 
I also made a small tweak to build.sh so that the tests run under 1.1 
where execute has problems finding ant.home with reletive paths. (my 
guess from looking at the problem is that this problem persists through 
all java before 1.3 but I havn't proven that.

Gus

Patrick (Gus) Heck wrote:

> I have written a symlink task which should be useful for managing 
> websites on unix or any other case where the symlinks in a directory 
> may constitute valuable information. This task allows one to quickly 
> and easily record the symlinks in an entire directory structure in a 
> properties file.
> This makes it possible to have a directory that consists entirely of 
> symlinks, and can be recreated without shell script and without typing 
> in the links by hand.
>
> The way I plan to use this is to record the links, and check the 
> properties files into CVS. This way when cvs checks them out it 
> creates the directories too. Then ant can come along and read the 
> properties file making all the links I need.
>
> I hope others will find this taks useful as well.
>
> The symlink task highlights:
> - make a symlink
> - delete a symlink without deleting the target file/directory
> - record all the symlinks in a directory tree in a properties file
> - recreate the symlinks in a directory tree from the properties file
> - failonerror or not
> - overwrite existing symlinks or not.
> - symlink deletion method is exposed as a static utility function for 
> use by developers
> - I have chosen not to expose the properites file creation method in 
> this task but both it and the symlink deletetion method might be 
> transportable to FileUtils.java (the method in the PropertyFile task 
> that I mostly copied is private). I will let the commiters decide on 
> this one however.
>
> Code and Testcases compiled and run on sun jdk 1.4.0 and ibm jdk 
> 1.1.8_v1 under linux 2.4 kernel
>
> Enjoy,
> Gus
>
>
>
>------------------------------------------------------------------------
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>