Date: 2007nov15
Protocol: ftp
Q. ftp: Ftp opens another socket every time it lists a directory's contents.
Is there a way my program can avoid this overhead?
A. The LIST and NLST server commands are usually done
when a client program does ls or dir. They open a new
socket and require either the POST or PASV commands before hand.
But the STAT command sends the same info and does not open
a new socket and associated complications.
To list the current directory do:
STAT .
To list another directory do:
STAT <dir>
You can also use:
MDTM <file>
SIZE <file>
To get a file's modify date/time and size via the same connection.