Hi,
I use class TFTP/TFTPFILE of the FWH and I am needing to rename files in directory ftp. How I can make this?
Hi,
I use class TFTP/TFTPFILE of the FWH and I am needing to rename files in directory ftp. How I can make this?
Vilian,
Please add this function to source\winapi\wininet.prg:
DLL32 FUNCTION FtpRenameFile( hFTP AS LONG, cOldFileName AS LPSTR, cNewFileName AS LPSTR ) ;
AS BOOL PASCAL ;
FROM "FtpRenameFileA" LIB hWinINet
And add this Method to Class TFtp:
METHOD RenameFile( cOldFileName, cNewFileName ) CLASS TFTP
return If( ::hFTP != nil, FtpRenameFile( ::hFTP, cOldFileName, cNewFileName ), .f. )
Thanks antonio.
Hi Antonio,
Already I tried to use oFtp:RenameFile() informing the way, without informing, but I do not obtain to rename archives. You can help me?
Vilian,
Please do a MsgInfo( oFTP:RenameFile( ... ) ) and lets check the returned value.
Antonio,
It´s returned value .F.
Vilian,
Does the FTP user have permit to rename files ?
Hi Antonio,
I have total access to directory ftp. I execute the command thus:
oFTP:RenameFile(;
"/ premierefilmes/web/txts/bilhetes/teste.old", "teste.txt")
Also already I tested thus:
oFTP:RenameFile(;
"/premierefilmes/web/txts/bilhetes/teste.old",;
"/premierefilmes/web/txts/bilhetes/teste.txt")
Hi Antonio,
The problem with the Rename command, is that it so changes the name of archives in the current directory, or either, that to move for the directory where is located the archive before executing the Rename command.
It will be that in the WinINet.dll we have a command equivalent to the Cd() of fivewin?
DLL32 FUNCTION FtpSetCurrentDirectory( hFTP AS LONG, cDirName AS LPSTR ) ;
AS BOOL PASCAL ;
FROM "FtpSetCurrentDirectoryA" LIB hWinINet METHOD SetCurrentDirectory( cDirName ) INLINE ;
FtpSetCurrentDirectory( ::hFTP, cDirName )Antonio,
Thanks for the evolution.