Hi,
There is a file. There are unicode characters in the name of this file. I need to copy this file to another disk. How can I do this ?
#include "FiveWin.ch"
FUNCTION Main()
LOCAL cSourceFile := "C:\FWH1701\SAMPLES\TUTOR04.PRG"
LOCAL cTargetFile := "C:\TEMP\TURO04.TXT"
? "Copiar de", cSourceFile, "Para", cTargetFile, "..."
? "Copiado", FileCopy( cSourceFile, cTargetFile ), "bytes"
RETURN NIL
#Include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------//
FUNCTION Main()
LOCAL oBar, cOrigen, cDestino
cOrigen := Curdrive()+":\fwh1701\samples\*.prg"
cDestino := Curdrive()+":\backup\"
DEFINE WINDOW oWnd TITLE "Copiar Archivos"
DEFINE BUTTONBAR oBar _3D OF oWnd
DEFINE BUTTON OF oBar ACTION( Copiar( cOrigen, cDestino ), oWnd:End() )
SET MESSAGE OF oWnd TO "Copiar Archivos" NOINSET CLOCK DATE KEYBOARD
ACTIVATE WINDOW oWnd CENTER
RETURN NIL
//----------------------------------------------------------------//
FUNCTION Copiar( cOrigen, cDestino )
LOCAL oFs
If .not. Lisdir( cDestino )
LMkdir( cDestino )
Endif
CURSORWAIT()
oFs := CreateObject( "Scripting.FileSystemObject" )
// oFs:CopyFile( "z:\systems\xml\*.xml" , "r:\backups\systems\xml\", .t. ) // .t. for overwrite
oFs:CopyFile( cOrigen, cDestino, .T. ) // .t. for overwrite
CURSORARROW()
? "Pronto..."
RETURN NIL
#Include "FiveWin.ch"
// Destino do Arquivo:
STATIC cTarget := "C: "
FUNCTION Main()
cTarget = AllTrim( cTarget )
// WinExec( "COPIAR.BAT", 0 ) // COPIAR.BAT
// DIRETO VIA FIVEWIN.
LZCopyFile( "CUSTOMER.DBF", cTarget + "\IMPREL\RONUEL.DBF" )
? [PRONTO, COPIADO!]
RETURN NIL
// FIN / END - By Joao Santos - kapiabafwh@gmail.com
Natter wrote:https://cloud.mail.ru/public/hiDS/DNt1MjWHS
LOCAL cPathSource := StrCapFirst( cFilePath( GetModuleFileName( GetInstance() ) ) + cFolderBK )
LOCAL cFile := ""
cPathSource := cShortName( cPathSource )
// cFile := cGetFile( "ZipFile | *.zip", "Pasta e Nome do Arquivo Para Fazer o Backup", 1, cPathSource, .T., .T. )
cFile := cGetFile( "ZipFile | *.zip", "Pasta e Nome do Arquivo Para Backup", 1, LFN2SFN(cPathSource), .T., .T. )
.OR.
::cDataDir := LFN2SFN(Alltrim(GetVV("oApp", "cDataDir" , ::cDataDir ) ))
::cLocalDir := LFN2SFN(Alltrim(GetVV("oApp", "cLocalDir" , ::cLocalDir ) ))
::cUpdateDir:= LFN2SFN(Alltrim(GetVV("oApp", "cUpdateDir", ::cUpdateDir ) ))
.OR.
cPRGPATH := cFILEPATH(GETMODULEFILENAME(GETINSTANCE()))
cPRGPATH := cShortName(cPRGPATH) //-> Modified / Modificado al final
/*
* SPN.PRG
*
* cShortName() - FilePath Long to Short (GetShortPathNameA())
*
* Soporte a Funciones del Api de Windows
*
* Andrade A. Daniel - 2002
* Rosario, Argentina
*
* Libre Distribución
*/
/*
* cShortName()
*/
FUNCTION cShortName( cLong )
Local cShort := Space(164) + Chr(0)
Local nBuffer := 164
Local nLen
nLen := GetSPName( cLong, @cShort, nBuffer )
cShort := Left( cShort, nLen )
RETURN( cShort )
// Windows Api
DLL32 STATIC FUNCTION GetSPName( lpszLongPath AS STRING, lpszShortPath AS STRING, lBuffer AS LONG ) ;
AS LONG PASCAL FROM "GetShortPathNameA" LIB "kernel32"
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 53 guests