ftp linux sample code. where of.........
ftp linux sample code. where of.........
ftp linux sample cords will be a possibility where of buying and peels.
FWH User
FWPPC User
FWLinux User
FWPPC User
FWLinux User
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Hi Antonio.
LINUX File Transfer Protocol (FTP) Client.
Composition or method?
Windows sample program-> Sees the sample code.
Linux sample program -> Does to do how from linux ?
OS->Centos 5.0
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 )
OS->Centos 5.0
FWH User
FWPPC User
FWLinux User
FWPPC User
FWLinux User