Hello,
Can someone please help me out with the command for how to set file date and time.
Best regards
Otto
Hello,
Can someone please help me out with the command for how to set file date and time.
Best regards
Otto
Master Otto, explain better what you need.
Regards, saludos.
Hello João,
I want to copy files to a server.
The files on the server should have the same date time as the original file.
Thank you in advance
Otto
Hello,
I think I found an example:
function setfiledate(cFile, dDate)
local hFile := FOpen( cFile, FO_READWRITE )
local aInfo
SET DATE FRENCH
SET CENTURY ON
SetFTime( hFile, "13:00:00", dDate )
// MsgInfo( "D o n e !" )
FClose( hFile )
return nil
I will test.
Best regards
Otto
There is a sample here:
C:\fwh\samples\testfdat.prg
Best regards
Otto
#include "FiveWin.ch"
#include 'common.ch'
#define SW_HIDE 0
#define SW_NORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_RESTORE 9
//------------------------------------*
// Deritrizes de fazer copia ou mover *
//------------------------------------*
#define FO_MOVE 0x0001
#define FO_COPY 0x0002
#define FO_DELETE 0x0003
#define FO_RENAME 0x0004
#define FOF_MULTIDESTFILES 0x0001
#define FOF_CONFIRMMOUSE 0x0002
#define FOF_SILENT 0x0004 // don't create progress/report
#define FOF_RENAMEONCOLLISION 0x0008
#define FOF_NOCONFIRMATION 0x0010 // Don't prompt the user.
#define FOF_WANTMAPPINGHANDLE 0x0020 // Fill in SHFILEOPSTRUCT.hNameMappings
// Must be freed using SHFreeNameMappings
#define FOF_ALLOWUNDO 0x0040
#define FOF_FILESONLY 0x0080 // on *.*, do only files
#define FOF_SIMPLEPROGRESS 0x0100 // means don't show names of files
#define FOF_NOCONFIRMMKDIR 0x0200 // don't confirm making any needed dirs
#define FOF_NOERRORUI 0x0400 // don't put up error UI
#define FOF_NOCOPYSECURITYATTRIBS 0x0800 // dont copy NT file Security Attributes
#define FOF_NORECURSION 0x1000 // don't recurse into directories.
//----------------------------> Copia o arquivo
FUNCTION execopia( warq, warq1 )
warq1 := alltrim( warq1 )
RETURN SHFile( , FO_COPY , warq + Chr( 0 ) , warq1 )#include "FiveWin.ch"
FUNCTION Main()
local cBuffer := Space( 12800 )
local nBufSize := 12800
hSource := FOpen( "Arquivo Original" )
hTarget := FCreate( "Arquivo Copia" )
While ( nBytes := FRead( hSource, @cBuffer, nBufSize ) ) > 0
FWrite( hTarget, cBuffer, nBytes )
SysRefresh()
End
FClose( hSource )
FClose( hTarget )
If File("Arquivo Copia")
...
Endif
Return nil#include "FiveWin.ch"
FUNCTION Main()
LOCAL cDirServ, cDirLocal, cArquivo
cDirServ := "\x_Archivos\"
cDirLocal := "E:\"
cArquivo := "teste.txt"
__CopyFile( cDirLocal+cArquivo, cDirServ+cArquivo+"2" )
RETURN NILHello João,
Thank you for your help.
I test with your code.
I map a drive on a web server with netDrive.
To synchronize data between my mod harbour web page and my desktop, I copy files like images, etc.
To keep traffic low, I would like to test it the file was changed (size, time, date) before I copy.
Best regards,
Otto
SetFDaTi( cFileName, dDate, cTime ) --> lSuccess FileAttr()
FileDate()
FileTime()
SetFAttr()
SetFDaTi()Hello,
I did some more tests, but it seems as you can't change date/time stamp on these through netDrive3 (http://www.netdrive.net) mapped drives.
It is interesting that if I upload a file to my webserver - I have the same time setup as on the local server - I have a time difference of 1 hour.
Maybe this has to do with summertime.
I do some more tests.
Best regards
Otto