Re: Empty directory listing
YES !!!!
Thank you a lot, Martin! It finally works :)))
You made me very happy today.
Thank you a lot, Martin! It finally works :)))
You made me very happy today.
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
site listfmt 1
, not listfmt 1
. And to call a raw FTP command in WinSCP script, you need to use the WinSCP call
command.
call site listfmt 1
"call site listfmt 1" ^
open
command)
namefmt
I would normally use from one IBMi to another is not recognized by the server when trying WinSCP script:
> 2022-07-12 11:08:02.543 Script: namefmt 1
< 2022-07-12 11:08:02.543 Script: Unknown command 'namefmt'.
. 2022-07-12 11:08:02.543 Script: Failed
. 2022-07-12 11:08:02.543 Script: Exit code: 1
. 2022-07-12 11:08:02.559 Disconnected from server
> 2022-07-12 12:43:57.094 LIST
. 2022-07-12 12:43:57.094 Connecting to address:10515 ...
. 2022-07-12 12:43:57.094 Cannot parse line:
. 2022-07-12 12:43:57.094 ID 86255 25.04.22 15.15.45 *STMF 222504BRMSRCY.TXT
. 2022-07-12 12:43:57.094 Cannot parse line:
. 2022-07-12 12:43:57.094 ID 1162 25.04.22 15.15.45 *STMF 222504BRMSRCY2.TXT
< 2022-07-12 12:43:57.094 125 List started.
. 2022-07-12 12:43:57.094 Data connection closed
. 2022-07-12 12:43:57.094 Unparsed listing:
. 2022-07-12 12:43:57.094 ID 114904 25.04.22 15.15.45 *STMF 222504BRMSBCK.TXT
. 2022-07-12 12:43:57.094 <Empty directory listing>
< 2022-07-12 12:43:57.132 250 List completed.
. 2022-07-12 12:43:57.132 Directory listing successful
. 2022-07-12 12:43:57.132 ..;D;0;1899-12-30T01:00:00.000Z;0;"" [0];"" [0];---------;0
< 2022-07-12 12:43:57.132 Script: No file matching '*.*' found.
. 2022-07-12 12:43:57.132 Copying 0 files/directories to local directory
Regarding the PowerShell: I understand that you are using PowerShell, not cmd, but you are running the plain old Windowsftp
from the PowerShell, right?
site listfmt 1
help?
ftp
from the PowerShell, right?
What kind of server is that? Can you attach a complete log?
By "FTP ... with PowerShell", I assume you actually mean plain old Windows command-lineftp
client.
LIST
command. What kind of server is that? Can you attach a complete log?
ftp
client. It uses NLST
command instead of LIST
). The NLST
produces just list of file names without any additional details. For trivial needs of Windows ftp
, it's satisfactory, as ftp
does not need to be able to tell files from folders, nor know file timestamps. But for GUI client (or scripting client that supports directory transfers and preserving of timestamps), it's far from enough.
"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.
ls
command, I can see the files, and can use mget
to fetch all of them.