Empty directory listing
Hello,
I'm encountering a strange behaviour when FTPing to one of my system. I have a directory there, containing 3 text files. I successfully connect to the system via WinSCP GUI, but I do not see anything in the remote directory, like the remote directory is empty. I have written the following script to get all the files from the directory without the need to use the GUI – the script looks like this:
And the script retrieves nothing. This is in the WinSCP log file (I have removed some confidential information):
WinSCP and FileZilla have the exact same issue where I have an empty directory listing when using their GUI.
But when I FTP to the system with PowerShell, I can use the
Could you please give me some advice where to look for errors? What does it mean 'Cannot parse line'?
Many thanks for advices.
I'm encountering a strange behaviour when FTPing to one of my system. I have a directory there, containing 3 text files. I successfully connect to the system via WinSCP GUI, but I do not see anything in the remote directory, like the remote directory is empty. I have written the following script to get all the files from the directory without the need to use the GUI – the script looks like this:
"open ftp://username:password@IPaddress/ -rawsettings ProxyPort=0" ^ "cd /brmsftp" ^ "lcd ""I:\BRMS Rcy rpt\""" ^ "mget -transfer=ascii *.*" ^ "exit"
. 2022-05-20 08:28:44.231 Using FTP protocol. . 2022-05-20 08:28:44.231 Doing startup conversation with host. < 2022-05-20 08:28:44.231 Script: Starting the session... > 2022-05-20 08:28:44.231 PWD < 2022-05-20 08:28:44.246 257 "QGPL" is current library. . 2022-05-20 08:28:44.246 Getting current directory name. . 2022-05-20 08:28:44.246 Startup conversation with host finished. < 2022-05-20 08:28:44.246 Script: Session started. < 2022-05-20 08:28:44.246 Script: Active session: [1] user@IPaddress > 2022-05-20 08:28:44.246 Script: cd /brmsftp . 2022-05-20 08:28:44.246 Changing directory to "/brmsftp". > 2022-05-20 08:28:44.246 CWD /brmsftp < 2022-05-20 08:28:44.262 250-NAMEFMT set to 1. < 2022-05-20 08:28:44.262 250 "/brmsftp" is current directory. . 2022-05-20 08:28:44.262 Getting current directory name. > 2022-05-20 08:28:44.262 PWD < 2022-05-20 08:28:44.262 257 "/brmsftp" is current directory. < 2022-05-20 08:28:44.262 Script: /brmsftp > 2022-05-20 08:28:44.262 Script: lcd "I:\BRMS Rcy rpt\" < 2022-05-20 08:28:44.262 Script: I:\BRMS Rcy rpt\ > 2022-05-20 08:28:44.262 Script: mget -transfer=ascii *.* . 2022-05-20 08:28:44.262 Retrieving directory listing... > 2022-05-20 08:28:44.262 TYPE A < 2022-05-20 08:28:44.262 200 Representation type is ASCII nonprint. > 2022-05-20 08:28:44.262 PASV < 2022-05-20 08:28:44.262 227 Entering Passive Mode (IP and ports). > 2022-05-20 08:28:44.262 LIST -a . 2022-05-20 08:28:44.262 Connecting to IP and port ... < 2022-05-20 08:28:44.278 550 Path does not exist: -a . 2022-05-20 08:28:44.278 Could not retrieve directory listing . 2022-05-20 08:28:44.278 LIST with -a failed, will try pure LIST . 2022-05-20 08:28:44.278 Retrieving directory listing... > 2022-05-20 08:28:44.278 TYPE A < 2022-05-20 08:28:44.278 200 Representation type is ASCII nonprint. > 2022-05-20 08:28:44.278 PASV < 2022-05-20 08:28:44.293 227 Entering Passive Mode (IP and port). > 2022-05-20 08:28:44.293 LIST . 2022-05-20 08:28:44.293 Connecting to IP and port ... < 2022-05-20 08:28:44.325 125 List started. . 2022-05-20 08:28:44.325 Cannot parse line: . 2022-05-20 08:28:44.325 userID 86255 25.04.22 15.15.45 *STMF 222504BRMSRCY.TXT . 2022-05-20 08:28:44.325 Cannot parse line: . 2022-05-20 08:28:44.325 userID 1162 25.04.22 15.15.45 *STMF 222504BRMSRCY2.TXT . 2022-05-20 08:28:44.325 Data connection closed . 2022-05-20 08:28:44.325 Unparsed listing: . 2022-05-20 08:28:44.325 userID 114904 25.04.22 15.15.45 *STMF 222504BRMSBCK.TXT . 2022-05-20 08:28:44.325 <Empty directory listing> < 2022-05-20 08:28:44.340 250 List completed. . 2022-05-20 08:28:44.340 Directory listing successful . 2022-05-20 08:28:44.340 ..;D;0;1899-12-30T01:00:00.000Z;0;"" [0];"" [0];---------;0 < 2022-05-20 08:28:44.340 Script: No file matching '*.*' found.
But when I FTP to the system with PowerShell, I can use the
ls
command, I can see the files, and can use mget
to fetch all of them.
Could you please give me some advice where to look for errors? What does it mean 'Cannot parse line'?
Many thanks for advices.