You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Bill Chmura <Bi...@Explosivo.com> on 2002/11/10 17:52:32 UTC

Need some advice

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need some advice -> with ANT FTP and symlinked files

Posted by Bill Chmura <Bi...@Explosivo.com>.
Sorry, as soon as it posted I realized what a dumb subject line that
was..


-----Original Message-----
From: Bill Chmura [mailto:Bill@explosivo.com] 
Sent: Sunday, November 10, 2002 11:53 AM
To: ant-dev@jakarta.apache.org
Subject: Need some advice 



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:
<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>