LIST command

Core FTP client questions and answers
Post Reply
S.A
Posts: 9
Joined: Fri Sep 02, 2005 8:18 pm

LIST command

Post by S.A »

The default keep-alive options were not working for me, so I used the keep-alive commands from SmartFTP as custom commands (LIST -aL and NOOP). However, it seems that the behavior of the LIST command in Core FTP and SmartFTP is different! Here is the output from SmartFTP:
LIST -aL
150 Opening ASCII mode data connection for file list
693 bytes transferred. (11.2 KB/s) (60 ms)
226 Transfer complete.
But when Core FTP uses the same command, it gives an error instead:
LIST -aL
425 Unable to build data connection: Invalid argument
I thought it might have been caused by using passive mode, but when I turned that off, I still got an error:
LIST -aL
425 Unable to build data connection: Connection refused
My second thought was that there was something wrong with the arguments, but I got the same result without them:
LIST
425 Unable to build data connection: Invalid argument
This is the same server, and I tested both clients within minutes of each other, so I don't think it's a server problem. And the LIST command in SmartFTP works just fine as a keep-alive command on this server. Also, transferring files works both ways in Core FTP. Any ideas what's wrong, or does anyone know of any keep-alive commands that would work?
S.A
Posts: 9
Joined: Fri Sep 02, 2005 8:18 pm

Post by S.A »

Here is the log for SmartFTP:
SmartFTP v1.5.988.24
Resolving host name "xxxxxxx.com"
Connecting to 66.98.xxx.xxx Port: 21
Connected to xxxxxxx.com.
220-This computer system is for authorized users only. Individuals using this
system without authority or in excess of their authority are subject to
having all their activities on this system monitored and recorded or
examined by any authorized person, including law enforcement, as system
personnel deem appropriate. In the course of monitoring individuals
improperly using the system or in the course of system maintenance, the
activities of authorized users may also be monitored and recorded. Any
material so recorded may be disclosed as appropriate. Anyone using this
system consents to these terms.


220 ProFTPD 1.2.10 Server (ProFTPD) [66.98.xxx.xxx]
USER xxxxxxx
331 Password required for xxxxxxx.
PASS (hidden)
230 User xxxxxxx logged in.
SYST
215 UNIX Type: L8
FEAT
211-Features:
MDTM
REST STREAM
SIZE
AUTH TLS
PBSZ
PROT
211 End
PWD
257 "/" is current directory.
TYPE I
200 Type set to I
PASV
227 Entering Passive Mode (66,98,xxx,xxx,158,155).
Opening data connection to 66.98.xxx.xxx Port: 40603
LIST -aL
150 Opening ASCII mode data connection for file list
693 bytes transferred. (5.63 KB/s) (120 ms)
226 Transfer complete.
PASV
227 Entering Passive Mode (66,98,xxx,xxx,158,174).
Opening data connection to 66.98.xxx.xxx Port: 40622
LIST -aL
150 Opening ASCII mode data connection for file list
693 bytes transferred. (11.2 KB/s) (60 ms)
226 Transfer complete.
And for Core FTP in passive mode:
Welcome to Core FTP, release ver 1.3c, build 1427 (U) -- © 2003-2005
WinSock 2.0
Mem -- 228,848 KB, Virt -- 2,097,024 KB
Started on Thursday September 08, 2005 at 11:36:AM
Resolving xxxxxxx.com...
Connect socket #444 to 66.98.xxx.xxx, port 21...
220-This computer system is for authorized users only. Individuals using this
system without authority or in excess of their authority are subject to
having all their activities on this system monitored and recorded or
examined by any authorized person, including law enforcement, as system
personnel deem appropriate. In the course of monitoring individuals
improperly using the system or in the course of system maintenance, the
activities of authorized users may also be monitored and recorded. Any
material so recorded may be disclosed as appropriate. Anyone using this
system consents to these terms.


220-This computer system is for authorized users only. Individuals using this
USER xxxxxxx
331 Password required for xxxxxxx.
PASS **********
230 User xxxxxxx logged in.
SYST
215 UNIX Type: L8
PWD
257 "/" is current directory.
Keep alive on...
PASV
227 Entering Passive Mode (66,98,xxx,xxx,159,177).
LIST
Connect socket #488 to 66.98.xxx.xxx, port 40881...
150 Opening ASCII mode data connection for file list
226 Transfer complete.
CWD /www
250 CWD command successful
CWD /
250 CWD command successful
Transferred 391 bytes in 0.008 seconds
LIST
425 Unable to build data connection: Invalid argument
And for Core FTP in active mode:
Welcome to Core FTP, release ver 1.3c, build 1427 (U) -- © 2003-2005
WinSock 2.0
Mem -- 228,848 KB, Virt -- 2,097,024 KB
Started on Thursday September 08, 2005 at 11:33:AM
Resolving xxxxxxx.com...
Connect socket #460 to 66.98.xxx.xxx, port 21...
220-This computer system is for authorized users only. Individuals using this
system without authority or in excess of their authority are subject to
having all their activities on this system monitored and recorded or
examined by any authorized person, including law enforcement, as system
personnel deem appropriate. In the course of monitoring individuals
improperly using the system or in the course of system maintenance, the
activities of authorized users may also be monitored and recorded. Any
material so recorded may be disclosed as appropriate. Anyone using this
system consents to these terms.


220-This computer system is for authorized users only. Individuals using this
USER xxxxxxx
331 Password required for xxxxxxx.
PASS **********
230 User xxxxxxx logged in.
SYST
215 UNIX Type: L8
PWD
257 "/" is current directory.
Keep alive on...
PORT 172,16,xxx,xxx,43,149
200 PORT command successful
LIST
150 Opening ASCII mode data connection for file list
226 Transfer complete.
CWD /www
250 CWD command successful
CWD /
250 CWD command successful
Transferred 391 bytes in 0.008 seconds
LIST
425 Unable to build data connection: Connection refused
I can see what's wrong in passive mode: the PASV command is not being issued before LIST. Is there a way to tell Core FTP to issue two commands, one after the other, in a custom keep-alive command? And I have no idea what's wrong with LIST in active mode, since transfers work fine in both modes. I really prefer Core FTP over SmartFTP, but I need to get keep-alive working somehow.
S.A
Posts: 9
Joined: Fri Sep 02, 2005 8:18 pm

Post by S.A »

CP wrote:I'm having difficulty reproducing this scenario here... Are there any other special settings or steps you are taking to get Core FTP to not issue the PASV command before the LIST command in the log? Are you using a custom command or a script? :?
This is through the keep-alive settings in View > Options > Connections. In the Keep Alive area, I have On and Custom checked, and the timer set to 50 seconds. Under Edit, I have the following commands listed:
LIST
NOOP
which is the same way I have SmartFTP's keep alive set up. Also, I tried the "treat links as directories" option, but it does not affect this problem. I appreciate the help, though.
S.A
Posts: 9
Joined: Fri Sep 02, 2005 8:18 pm

Post by S.A »

CP wrote:I see, so it was something that was entered! For a minute there I thought Core FTP had suddenly taken on a mind of it's own (which it has in the past). :)

We'll add the PASV/PORT to the custom LIST command in the next build (1428).
Great, thank you!
S.A
Posts: 9
Joined: Fri Sep 02, 2005 8:18 pm

Post by S.A »

I noticed a small bug in the custom LIST keep-alive command (hopefully I'm not the only one who uses it, but it is convenient to stay connected to the FTP server while I'm writing code). When connecting to a Pure-FTP server, the custom LIST command sorts everything by name rather than listing directories first and then files underneath, which causes folders and files to be interspersed on the remote list. The standard LIST command issued when a folder is viewed, however, displays the listing correctly. I don't think I saw this behavior when connecting to ProFTPD servers, although I'm not 100% sure on that. Additionally, there appears to be a blank file slot that appears at the bottom of the list when the custom LIST command is issued, so when a new file is uploaded, there is a blank space in the middle.

Here are some screenshots:
Before the custom LIST command:
Image

After the custom LIST command (and uploading a new file):
Image
S.A
Posts: 9
Joined: Fri Sep 02, 2005 8:18 pm

Post by S.A »

Thanks for the reply. The above testing was done using build 1447.3.
S.A
Posts: 9
Joined: Fri Sep 02, 2005 8:18 pm

Post by S.A »

I've seen it on two computers running Windows XP. One is a 850MHz AMD Duron with 256MB RAM, and the other is a 2.8GHz Pentium 4 with 1GB RAM. Also, the second computer has XP SP2 installed.
Brendon K
Posts: 139
Joined: Mon Aug 15, 2005 8:16 pm

Post by Brendon K »

I've also seen the error from the 2nd image occur. I *think* I've made the error from the first window occur when choosing a sort method accidentally...haven't seen it since though.

The null space for a "hidden" file occurred only after I made a whole slew of changes in my preferences. Unfortunately, because I made so many it was rather difficult for me to pinpoint exactly which one (or combination of them) caused the problem. If I refresh the folder view (using the refresh button) it will remove that hidden file and display the contents of the directory as it should be.

P.S. - The error in the 2nd image still occurs with my preferences in LE build 1451 on WinXP SP2.
S.A
Posts: 9
Joined: Fri Sep 02, 2005 8:18 pm

Post by S.A »

Thanks for confirming the issue, Brendon.

I've done some testing on FTP servers that are running software other than Pure-FTP and noticed both problems there as well, so it turns out that it is not related to Pure-FTP after all.

If anyone else would like to try testing this, here are the steps to reproduce it:
  1. Go to View -> Options.
  2. Select the Connections setting on the left.
  3. In the Keep Alive section, check the boxes next to On and Custom, and enter 50 into the timer box.
  4. Click the Edit button, remove anything listed there, and enter the commands LIST and NOOP.
  5. Connect to an FTP server and browse to a directory that contains files as well as other directories.
  6. Wait 50 seconds, and the listing will get jumbled up while refreshing.
  7. If you upload a new file at this point, there will be a blank file slot between the last entry in the listing and the newly uploaded file.
S.A
Posts: 9
Joined: Fri Sep 02, 2005 8:18 pm

Post by S.A »

That fixed the problem. Thanks!
Post Reply