Browse - Programming Tips - Ftp opens another socket every time it lists a directory's contents.
Q. 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:
To list another directory do:
You can also use:
To get a file's modify date/time and size via the same connection.