ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Chmura" <B...@Explosivo.com>
Subject Need some advice
Date Sun, 10 Nov 2002 16:52:32 GMT

Hello, I am working on a patch to fix bug 14063, a problem with ANT FTP
not downloading symlinked files...

I know what the problem is, and I have fixed it so that I solves my
needs - but would like to make a better fix for it...

Here is my confusion...

Once there was an object named FTPFile...  It represented a file on an
FTP server.  It had four calls that are relevant here...

isFile() - returns true if the object represents a file
isDirectory() - returns true if the objected represents a directory
isSymbolicLink() - returns true if the object is really a symbolic link
getLinkName() - or something similar - it eludes me right now... Returns
what a symlink points too...

Okay, here is what happens...

If a listing on an FTP is a symlink it returns false for isFile and
isDirectory which is why the current code skips any symlinks it finds.
I posted a work around for that in the bug report.  All we need to do is
check to see if it is a symlink and process the includes and excludes
the normal way.

Now the problem.  I cannot figure out a way to tell if the symlink
points to a file or a directory.  I think the behavior should follow the
normal ANT behavior and not worry if it's a symlink.  But there seems to
be no way to cleanly do this...

For example, if have a symlinked entry and I call the getLinkName() it
will return something like:

/www/logs/explosivo-access-log
Or 
/www/explosivo

Now there is no way to tell heuristically which is a file and which is a
directory...

My first thought was to do another FTP scan to the area it is pointing
to and see if it is a file or directory, but in my case I cannot do
listings on the destination directory so that is not a clean fix.

I went in with command line ftp and poked and prodded but cannot find a
way to tell them apart...  The file permissions are all the same and
stuff...


Anyone have any ideas?











William B Chmura
Director of Internet Technology
Explosivo Internet Technology Group
http://www.Explosivo.com
Tel: (888) 560-YWEB



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message