FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FTP Directory and File Handling
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
FTP Directory and File Handling
Posted: Wed Jun 22, 2011 11:12 PM

I am not having luck with the Fivewin / xHarbour FTP classes.

I successfully attach to the my FTP site using the sample programs as a guide. Steps 1 and 2 work fine. But when I try to process files and directory methods,
I run into problems.
There are files out there, for sure as I see and manipulate via Explorer.

  1. oInternet := TInternet():New()
  2. oFTP := TFTP():New( cFTPSite, oInternet, userid, passwd )
  3. aFiles = oFTP:Directory( "." )
    aFiles[1][1] " "
    aFiles[1][2] 0
    aFiles[1][3] 01/01/01
    aFiles[1][4] "00:00:00"

If I look for specific file which I know is there, I get the same result.

Simiar problems using the TFtpFile class also result in no bytes to be transfered.

oFile = TFtpFile():New( aSource[ n ], oFTP )
oFile:OpenRead()
oFile:Read( nBufSize )

Any ideas why I can't see or use files on the FTP site?
I'm using FWH 10.1 with xHarbour 1.2 and Borland BCC 5.5

Thank you in advance for any hints.

Don Lowenstein
www.laapc.com
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: FTP Directory and File Handling
Posted: Thu Jun 23, 2011 09:20 AM

3. aFiles = oFTP:Directory( "." )

Please check the landing path after establishing the FTP connection. You may be in a wrong path while using oFtp:Directory(".")

For Eg.

aFiles:=oFtp:Directory("Web/cstock/CStock.exe" )  // Be careful, it is case sensitive

I feel that it is the path problem. :)

Regards
Anser

Continue the discussion