EldoS | Feel safer!

Software components for data protection, secure storage and transfer

FTP client problem

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#36298
Posted: 03/23/2016 17:34:31
by Ivan Demkovitch (Standard support level)
Joined: 11/10/2013
Posts: 23

Hi!

I'm raising same topic again. Yet another FTP server with different format :)
Do you know if I can count on 3 things?
1. File name is last one in line
2. Each line element positions same all the time (like file name starts at 47..) and not delimited with single space or tab
3. File is "1" and directory is "2"

Code
-rw-rw-rw-  1              generic           1091 Mar 21 12:49 204-12345-1234-6171827455.edi


I see samples where people do regex and there is tons of variations.. You suggested split but there is issue with spaces in file names. Code in FileZilla is a mess :)

All I need to know is:
1. It's file, not directory
2. File name

So, if those 3 assumptions true - I can just say that I need 2 numbers for each server. Index of file type(and file type 1 char) and index of file name(and it goes to end of line)

But do those #1-#3 correct?
#36307
Posted: 03/24/2016 04:07:40
by Eugene Mayevski (EldoS Corp.)

Unfortunately you can't count on anything because listing formats are not defined in any standard. If the server supports MLST command, you can use that one to get the list in the standard format. But MLST is an extension, not supported by all servers.


Sincerely yours
Eugene Mayevski
#36311
Posted: 03/24/2016 09:49:49
by Ivan Demkovitch (Standard support level)
Joined: 11/10/2013
Posts: 23

MLST is ideal - 95% of customers like that. But there is some that differ. I wonder if I should create mapper per each customer and don't try and make it general...
#36312
Posted: 03/24/2016 10:20:26
by Eugene Mayevski (EldoS Corp.)

Unfortunately if the server doesn't support MLST, then the best option is try to use one of parsers that we offer right in SecureBlackbox, but if it fails, try to parse the line yourself. And then, yes, you would need to accommodate your code to each customer's server, unfortunately.


Sincerely yours
Eugene Mayevski
#36313
Posted: 03/24/2016 10:30:41
by Ivan Demkovitch (Standard support level)
Joined: 11/10/2013
Posts: 23

Quote
try to use one of parsers that we offer right in SecureBlackbox


How do I use them? Can you point to documentation?
#36314
Posted: 03/24/2016 10:37:38
by Eugene Mayevski (EldoS Corp.)

Could you please specify which version of SecureBlackbox are you using? Also please specify the name of the method in TElSimpleFTPSClient that you are using now to get the listing.


Sincerely yours
Eugene Mayevski
#36315
Posted: 03/24/2016 10:40:17
by Ivan Demkovitch (Standard support level)
Joined: 11/10/2013
Posts: 23

We are on version 11

For MLST clients I call this:
Quote
client.GetFileList(string.Empty, fileList);


For other I call this and manually parse:
Quote
client.GetFileList();
#36316
Posted: 03/24/2016 10:46:29
by Eugene Mayevski (EldoS Corp.)

Use ParseFileListEntry method for human-readable listings and ParseMLSDEntry for servers that support MLSD.

BTW there were numerous security improvements in SecureBlackbox 13 and 14, so we strongly recommend everyone to upgrade.


Sincerely yours
Eugene Mayevski
#36317
Posted: 03/25/2016 10:48:13
by Ivan Demkovitch (Standard support level)
Joined: 11/10/2013
Posts: 23

I asked that customer if they can enable MLSD and they said they support NLST

From what I understand NLST is just a list of files which is OK for us, is there any way to use that command?
#36318
Posted: 03/25/2016 10:53:32
by Vsevolod Ievgiienko (EldoS Corp.)

Hello.

TElSimpleFTPSClient.GetNameList method is implemented via NLST: https://www.eldos.com/documentation/sb...elist.html
Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.

Reply

Statistics

Topic viewed 4857 times

Number of guests: 2, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!