FluentFTP: GetListing returns wrong name
FTP OS: OS/400 is the remote operating system.
FTP Server: IBMOS400FTP
Computer OS: Windows 10
FluentFTP Version: 40.0.0
Framework: .NET 6
Hi - we have a problem with an specific FTP Server. When we do an GetListing("remote directory) - the resulting file names contains the directory name - and so an download fails because the directory name is wrong (doubled)
Here the ftp server contains an directory “download” - the GetListing shows correctly all files - but the Name contains the directory name - and the FullName shows the wrong directory because “download” is now 2 times in the path?

Filezilla:

Logs :
# AutoConnect()
# AutoDetect(True, False)
# Connect()
Status: Connecting to ***:21
Response: 220-QTCP at holter.ad.holter.at.
Response: 220 Connection will close if idle more than 5 minutes.
Status: Detected FTP server: IBMOS400FTP
Command: AUTH TLS
Response: 431 Requested security mechanism not available at this time.
Command: USER ***
Response: 331 Enter password.
Command: PASS ***
Response: 230 *** logged on.
Command: FEAT
Response: 211-Feature listing follows:
Response: AUTH TLS
Response: AUTH GSS
Response: CCC
Response: PBSZ
Response: PROT
Response: ADAT
Response: ENC
Response: MIC
Response: CONF
Response: 211 End of feature listing.
Status: Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Command: OPTS UTF8 ON
Response: 501 OPTS unsuccessful; specified subcommand not recognized.
Command: SYST
Response: 215 OS/400 is the remote operating system. The TCP/IP version is "V7R4M0".
Status: Listing parser set to: IBMOS400
# GetListing("download", Auto)
Command: PWD
Response: 257 "/kundenftp/KU0021235" is current directory.
Command: TYPE I
Response: 200 Representation type is binary IMAGE.
# OpenPassiveDataStream(PASV, "LIST /kundenftp/KU0021235/download", 0)
Command: PASV
Response: 227 Entering passive mode (212,183,28,50,158,96).
Status: Connecting to ***:40544
Command: LIST /kundenftp/KU0021235/download
Response: 125 List started.
+---------------------------------------+
Listing: MARKUSP 8192 16.03.30 09:00:51 *DIR download/datanorm/
Listing: SICHERN 2865 22.09.01 04:36:04 *STMF download/B0220831.013
Listing: SICHERN 504 22.09.02 04:37:50 *STMF download/B0220902.001
Listing: SICHERN 320 22.09.02 04:37:50 *STMF download/B0220902.002
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (1 by maintainers)
@robinrodricks As a first step could you put this on the todo list? With the help of @noxe I think this can be done within a sensible timeframe
Ok. I have got some observations and questions, after doing some research.
Does this work with a FluentFTP version prior to V.40?
It seems to me, that by listing a directory, the output
download/B0220831.013is taken as a filename and appended to the listing path, giving a doubledownloads. This means that as a “quick” fix you couldSetWorkingDirectorytodownloadand thenGetListing("", FtpListOption.NoPath). Does this work for you?I can see in the code that there is no adequate reaction to
download/B0220831.013havingdownload/prepended to the file name. It looks like you are expected to CWD to the actual directory before doing your GetListing.