Login  
Search All Forums
Dart Home | PowerTCP FTP for ActiveX | Custom Development Reply | PowerTCP FTP for ActiveX Topics | Forums   
AuthorForum: PowerTCP FTP for ActiveX
Topic: FTP to AS400 with C++
atakahashi

From: London, United Kingdom
Posts: 1
Member Since: 10/28/04
posted October 28, 2004 5:26 AM

Hi,

We are having trouble using Dart FTP LIST methods with our VC++ programs and need an assitance very urgently.

The functionality we are looking are as follows,
1) We wanted to check if the files exist on our remote AS400 server.

I have used List method "ftp::List(path name)". This works fine on NT server as path name has maximum size of 255, whereas path name has size restriction on AS400 machine, which is only 10 char long. Therefore I could only pass directory name to it. But this way I am unable to capture file list return by the above method.

How can I capture list of files returned by the above function for AS400 remote server and verify if the filename I am looking, exists on the remote server.

I appreciate a quick feedback from someone.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 28, 2004 4:46 PM

Try changing into the directory first, then just call List() with no path. That's the appraoch we take in the sample apps
kosuket

From: London, United Kingdom
Posts: 2
Member Since: 10/29/04
posted October 29, 2004 5:49 AM

Thanks for the reply but I have already tried that step and it works. But I am stuck after that step as I am unable to capture list of files returned by the List() on AS400.

There are functions like Listing available but didn't work on AS400.

What I am looking is the steps (or list of commands) after List() command is executed on AS400 so that I can process each files existing under that directory.

As you can see from my 1st mail that my objective is to check if certain file exists on the AS400 machine. Any alternative ideas are appreciated too.


Your last reply: Try changing into the directory first, then just call List() with no path. That's the appraoch we take in the sample apps.


Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 29, 2004 8:48 AM

Since the only listing types automatically handled by us are the DOS and UNIX styles, you will have to parse the info you are looking for out of the raw data returned in the response to the LIST command.

The info you need is in the ListEntries.Text property.
kosuket

From: London, United Kingdom
Posts: 2
Member Since: 10/29/04
posted October 31, 2004 6:30 AM

Question
The above suggestion worked when we call ListEntries.Text from Visual Basic code but unable to use same method when called from Visual C++.
I am looking for a specifically equivalent method to ListEntries.Text in VC++ to capture string of filenames returned by the List() command.

Please suggest METHODS to check File Exist on AS400 server using VC++ program (Not Visual Basic metods).

History:
I have tried calling various method from VC++ code after List() command but none has given me the required result,
1) step 1: GetListing()    
step 2: getcount()     
* Success, returns number of file returned by the command(step1), when tested on NT server.
But failed to return number of file , when tested on AS400 server.

2) Status (result, pathname) // Failed

Thanks.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 31, 2004 12:22 PM

This code worked for me when I added it to the sample ListView apps "DisplayListing" function:

MessageBox((char *)le->Text,"Raw Listing",MB_OK);

On your system this should give you the data that you AS400 machine is giving us.


Reply | PowerTCP FTP for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX