Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.3k views
in .NET FTP by (240 points)
Hi,

I am using dirDetails(".") to get a list of FTPFile from a remote site

6 Answers

0 votes
by (51.6k points)
Can you please log in from the command-line, get a listing and then post it here so that we can have a look at what the server is returning?

- Hans (EDT)
0 votes
by (240 points)
Here it is:

ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 32
-rw-r--r-- 1 ycao users 11 Apr 14 11:44 a
drwxr-xr-x 4 ycao users 4096 Aug 28 17:11 ftp
drwxr-xr-x 2 ycao users 4096 Apr 24 15:05 image
-rw-r--r-- 1 ycao users 11 Apr 18 14:09 yyyxxx
226 Transfer complete.
ftp: 249 bytes received in 0.00Seconds 249000.00Kbytes/sec.

Thanks.


Yican
0 votes
by (51.6k points)
I can't see anything in that listing that would indicate any problem. Can you please turn on logging and post a log of your session?

If you feel adventurous, then another thing you can try is to link the edtFTPnet source into your application, put a breakpoint in UnixFileParser.Parse(string) and step through the code. It gets called once for each line in the directory listing, so in this case it should get called four times; the second and third calls being for the subdirectories.

- Hans (EDT)
0 votes
by (240 points)
I think there is a bug in dirDetails("."). If I use dirDetails(dirpath) I got both files and subdirectories, where dirpath is a String of absolute directory path. Maybe you can compare those two. Thanks.

Yican
0 votes
by (51.6k points)
Would you be able to log into your server again from the command line and call both "dir ." and "dir <absolute-path>", just to see if the server is returning different things?

- Hans (EDT)
0 votes
by (240 points)
Aha, there is different, and it explains. Thanks.

Yican

FYI, the difference as follows:

ftp> dir .
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
-rw-r--r-- 1 ycao users 11 Apr 13 17:53 a

test:
total 32
-rw-r--r-- 1 ycao users 11 Apr 14 11:44 a
drwxr-xr-x 4 ycao users 4096 Aug 30 15:10 ftp
drwxr-xr-x 2 ycao users 4096 Apr 24 15:05 image
-rw-r--r-- 1 ycao users 11 Apr 18 14:09 yyyxxx
226 Transfer complete.
ftp: 315 bytes received in 0.01Seconds 21.00Kbytes/sec.
ftp> dir /home/mdax/a/ycao/
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 48
-rw------- 1 ycao users 1919 Aug 31 12:47 .bash_history
-rw-r--r-- 1 ycao users 76 Mar 27 16:16 .bashrc
-rw------- 1 ycao users 358 Aug 24 14:18 .sh_history
drwx------ 2 ycao users 4096 Mar 27 17:10 .ssh
-rw-r--r-- 1 ycao users 11 Apr 13 17:53 a
drwxr-xr-x 4 ycao users 4096 Aug 24 14:34 test
226 Transfer complete.
ftp: 386 bytes received in 0.00Seconds 386000.00Kbytes/sec.

Categories

...