ftp linux sample code. where of.........

Post Reply
yunbg1
Posts: 107
Joined: Sun Nov 13, 2005 12:40 am
Location: Winnipeg Canada

ftp linux sample code. where of.........

Post by yunbg1 »

ftp linux sample cords will be a possibility where of buying and peels.
FWH User
FWPPC User
FWLinux User
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

I don't understand what you mean, sorry.

Could you explain with more detail your question ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
yunbg1
Posts: 107
Joined: Sun Nov 13, 2005 12:40 am
Location: Winnipeg Canada

Post by yunbg1 »

Hi Antonio.

LINUX File Transfer Protocol (FTP) Client.
Composition or method?

Windows sample program-> Sees the sample code.

Code: Select all


hLib := LOADLIB32( "wininet.dll" )
hInternet := INETOPEN( "Anystring", 0, 0, 0, 0 )
hConnect := INETCONNECT( hInternet, cFtpSite, 21, cFtpUser, cFtpPassword, INTERNET_SERVICE_FTP, 0, 0 )
nSize := ftp_dir(cFTPRemote)
nFileSize := 0
if file(cFtpLocal)
   nFileSize := FSize(cFtpLocal)
   if nFilesize != nSize
      ferase(cFtpLocal)
     else
      lReturn := .t.
      iNetClose( hConnect )
      iNetClose( hInternet )
      FreeLib32( hLib )
      RETU lReturn
   endi
endi

if nSize == 0
   lReturn := .f.
  else
   hFile := FtpOpenFile( hConnect, cFtpRemote, GENERIC_READ, FTP_TRANSFER_TYPE_BINARY, 0 )
   if hFile == 0
      lReturn := .f.
     else
      handle := fcreate(cFtpLocal)
      if handle == -1
         RETU (.f.)
      endi
      cBuffer := Space( nBytes )
      co1 := 0
      do while .t.
         lReturn := InternetReadFile(hFile, cBuffer, nBytes, @nRead)
         if lReturn == .f.
            exit
         endi
         fwrite(handle, cBuffer, nRead)
         nProgress := nProgress + nRead
         if nProgress >= nSize
            exit
         endi
      endd
      fclose(handle)
      iNetClose( hFile )
   endi
endi
iNetClose( hConnect )
iNetClose( hInternet )
FreeLib32( hLib )

Linux sample program -> Does to do how from linux ?
OS->Centos 5.0
FWH User
FWPPC User
FWLinux User
Post Reply