Rename files in directory ftp
Rename files in directory ftp
Hi,
I use class TFTP/TFTPFILE of the FWH and I am needing to rename files in directory ftp. How I can make this?
I use class TFTP/TFTPFILE of the FWH and I am needing to rename files in directory ftp. How I can make this?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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. )
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. )
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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?
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?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Vilian,
Add this to source\winapi\wininet.prg:
And this to Class TFtp:
Add this to source\winapi\wininet.prg:
Code: Select all
DLL32 FUNCTION FtpSetCurrentDirectory( hFTP AS LONG, cDirName AS LPSTR ) ;
AS BOOL PASCAL ;
FROM "FtpSetCurrentDirectoryA" LIB hWinINet
Code: Select all
METHOD SetCurrentDirectory( cDirName ) INLINE ;
FtpSetCurrentDirectory( ::hFTP, cDirName )