Amigos,
Necesito saber la ultima fecha en la que una carpeta de windows tuvo cambios.
¿Hay alguna manera?
#include "FiveWin.ch"
function Main()
XBrowse( FW_FolderChanged( "c:\fwh" ) )
return nil
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
HB_FUNC( FW_FOLDERCHANGED )
{
const char * folderPath = hb_parc( 1 );
FILETIME lastWriteTime;
WIN32_FILE_ATTRIBUTE_DATA fileAttributes;
SYSTEMTIME systemTime;
GetFileAttributesEx( folderPath, GetFileExInfoStandard, &fileAttributes );
lastWriteTime = fileAttributes.ftLastWriteTime;
FileTimeToSystemTime(&lastWriteTime, &systemTime);
hb_reta( 6 );
hb_storvnl( systemTime.wDay, -1, 1 );
hb_storvnl( systemTime.wMonth, -1, 2 );
hb_storvnl( systemTime.wYear, -1, 3 );
hb_storvnl( systemTime.wHour, -1, 4 );
hb_storvnl( systemTime.wMinute, -1, 5 );
hb_storvnl( systemTime.wSecond, -1, 6 );
}
#pragma ENDDUMP
Antonio Linares wrote:Estimado José,
Aquí lo tienes. Lo incluimos para el próximo build de FWH:
function FW_FolderChanged( cFolderPath ) --> { nDay, nMonth, nYear, nHours, nMinutes, nSeconds }
- Code: Select all Expand view
#include "FiveWin.ch"
function Main()
XBrowse( FW_FolderChanged( "c:\fwh" ) )
return nil
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
HB_FUNC( FW_FOLDERCHANGED )
{
const char * folderPath = hb_parc( 1 );
FILETIME lastWriteTime;
WIN32_FILE_ATTRIBUTE_DATA fileAttributes;
SYSTEMTIME systemTime;
GetFileAttributesEx( folderPath, GetFileExInfoStandard, &fileAttributes );
lastWriteTime = fileAttributes.ftLastWriteTime;
FileTimeToSystemTime(&lastWriteTime, &systemTime);
hb_reta( 6 );
hb_storvnl( systemTime.wDay, -1, 1 );
hb_storvnl( systemTime.wMonth, -1, 2 );
hb_storvnl( systemTime.wYear, -1, 3 );
hb_storvnl( systemTime.wHour, -1, 4 );
hb_storvnl( systemTime.wMinute, -1, 5 );
hb_storvnl( systemTime.wSecond, -1, 6 );
}
#pragma ENDDUMP
Antonio Linares wrote:Estimado José,
Aquí lo tienes. Lo incluimos para el próximo build de FWH:
function FW_FolderChanged( cFolderPath ) --> { nDay, nMonth, nYear, nHours, nMinutes, nSeconds }
- Code: Select all Expand view
#include "FiveWin.ch"
function Main()
XBrowse( FW_FolderChanged( "c:\fwh" ) )
return nil
#pragma BEGINDUMP
#include <Windows.h>
#include <hbapi.h>
HB_FUNC( FW_FOLDERCHANGED )
{
const char * folderPath = hb_parc( 1 );
FILETIME lastWriteTime;
WIN32_FILE_ATTRIBUTE_DATA fileAttributes;
SYSTEMTIME systemTime;
GetFileAttributesEx( folderPath, GetFileExInfoStandard, &fileAttributes );
lastWriteTime = fileAttributes.ftLastWriteTime;
FileTimeToSystemTime(&lastWriteTime, &systemTime);
hb_reta( 6 );
hb_storvnl( systemTime.wDay, -1, 1 );
hb_storvnl( systemTime.wMonth, -1, 2 );
hb_storvnl( systemTime.wYear, -1, 3 );
hb_storvnl( systemTime.wHour, -1, 4 );
hb_storvnl( systemTime.wMinute, -1, 5 );
hb_storvnl( systemTime.wSecond, -1, 6 );
}
#pragma ENDDUMP
function FolderInfo()
local oFs := CreateObject( "Scripting.FileSystemObject" )
local oFolder := oFs:GetFolder( "c:\fwh\samples" )
? oFolder:DateCreated, oFolder:DateLastModified, oFolder:DateLastAccessed
return nil
function TimeZoneConversions()
local tDateTimeLocal, tDateTimeUTC, tDateTimeNYC
tDateTimeLocal := HB_DateTime() // current time
tDateTimeUTC := UTC_TIMESTAMP( tDateTimeLocal ) // FWH function
tDateTimeNYC := FW_ADDTIME( tDateTimeUTC, "-05:00:00" )
? tDateTimeLocal, tDateTimeUTC, tDateTimeNYC
return nil
tsUTC := FW_AddTime( DateTimeSpain. "-01:00:00" )
tsIndia := FW_AddTime( tsUTC, "05:30:00" )
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: cmsoft, Google [Bot] and 48 guests