标签:exist pre pen min 创建时间 err sizeof cal end
FILETIME stLocal;
SYSTEMTIME stsystime;
FILETIME ftCreate, ftModify, ftAccess;
HANDLE hFile = CreateFile(path, GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
NULL);
if (!GetFileTime(hFile, &ftCreate, &ftAccess, &ftModify))
{
G_ST_return_code.Create_File_Error = TRUE;
goto end;
}
ZeroMemory(&stLocal, sizeof(SYSTEMTIME));
FileTimeToLocalFileTime(&ftCreate, &stLocal);
FileTimeToSystemTime(&stLocal, &stsystime);
sprintf(data, "%04d-%02d-%02d %02d:%02d:%02d", stsystime.wYear, stsystime.wMonth, stsystime.wDay, stsystime.wHour, stsystime.wMinute, stsystime.wSecond); // 文件创建时间
S_FileInfo = data;
标签:exist pre pen min 创建时间 err sizeof cal end
原文地址:http://blog.51cto.com/haidragon/2344205