Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.2k views
in Java FTP by (120 points)
Hi,

I experienced a problem with the dirDetails() method. I'm trying to get the listing of the directory "dummy"

lrwxrwxrwx 1 root root 24 Apr 26 10:46 dummy -> /root/dummy2

which is a softlink to a real directory. The method should give me back the content list of "dummy", but it gives me an array of FTPFile which contains only one element, the softlink itself.

Apr 26, 2007 1:17:00 PM - - LogManager$RootLogger - log() - _ftp_client.pwd(): /root/dummy
Apr 26, 2007 1:17:00 PM - - LogManager$RootLogger - log() - dirDetails FTPFile[] size: 1
Apr 26, 2007 1:17:00 PM - - LogManager$RootLogger - log() - dirDetails FTPFile[0] name: /root/dummy

The directory /root/dummy2 exists and it contains:
lrwxrwxrwx 1 root root 24 Apr 26 10:46 dummy_file

I'me here for further informations.

Best Regards,

/Yuri

1 Answer

0 votes
by (162k points)
Symbolic links can be problematic with some FTP servers. Many Unix servers use chroot to restrict users which can cause problems (e.g. users can't see symlinked directories outside of their home directory).

Best thing to do is log in via command line FTP and experiment with the 'dir' and 'ls' commands. Type 'debug' so you can see the commands, and change into the directory and try 'dir -L'.

If that succeeds in listing the files, note the command being sent (probably LIST -L) and supply the '-L' to the dirDetails() command.

Also, some FTP servers can be configured not to display symbolic links, i.e. the listings they supply to clients follow the links automatically. You might want to check out the server settings if you can.

Categories

...