问题描述
您好,
我们的系统是Windows服务器2012(2014年更新),编译器是旧的Visual6,带有补丁,可以在最近的操作系统上运行它。
我们运行一个排序实时预测器,用输入数据(简单的.txt文件)计算流量,这通常每分钟都会改变。
我们试图使用检查这些文件的同时性以接受或拒绝磁盘上存在的文件(一分钟的计算周期)的不同技术,它们内部并没有说出关于它们的日期的东西所以我们必须
请求系统的原语来说明这些文件是否同时存在。
下面的代码运行了几个小时,然后在void CFileFind :: AssertValid()const中停止,当这个文件被void AFXAPI调用时AfxAssertValidObject(const CObject * pOb,
LPCSTR lpszFileName,int nLine)
由 调用C.FindNextFile();
???
我们的上游呼叫代码是
/ * HANDLE hFile = CreateFile(Rep,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
FILETIME ftCreate,ftAccess,ftWrite;
SYSTEMTIME stUTC,stLocal;
if(!GetFileTime(hFile,& ftCreate,& ftAccess,& ftWrite))
    返回-1;
// VIRE汽车返程souvent -1 sans raison Xa sept 2016
FileTimeToSystemTime(& ftAccess,& stUTC);
SystemTimeToTzSpecificLocalTime(NULL,& stUTC,& stLocal);
  CloseHandle的(HFILE);
* /
// CFileFind C;
CFileFind2 C;
CTime T;
C.FindFile(Rep,0);
  C.FindNextFile(); // bug system 18 oct2016Àfaire:gestion des exceptions?
// C.GetCreationTime(T);
C.GetLastWriteTime(T);
* Jour = T.GetDay();
* Mois = T.GetMonth();
* An = T.GetYear(); // semble marcher 7/9/16
$
// * Jour = stLocal.wDay;
// * Mois = stLocal.wMonth;
// * An = stLocal.wYear;
  C.Close(); // ferme recherche
  C.CloseContext(); // ferme fichier(est-il ouvert?)
FILE * in = fopen(Rep," r");
if(in)
{
...
有人有想法吗?
Xavier
Hello,
Our system is a Windows server 2012 (updated 2014) and the compilator an old Visual6 with a patch to run it on that recent OS.
We run a sort real-time forecaster that computes flows with incoming data (simple .txt files) which normally changes each minute.
We have tried to use different techniques to check the simultaneity of these files to accept or reject the one present on the disk at moment of use (cycle of computations of one minute), the inside of them does'nt say anaything about their date so we must ask for system's primitive to say if these files are contemporaneous.
The code below runs for hours, then stops in void CFileFind::AssertValid() const when this one is called by void AFXAPI AfxAssertValidObject(const CObject* pOb,
LPCSTR lpszFileName, int nLine)
called by C.FindNextFile();
???
Our upstream calling code is
/* HANDLE hFile = CreateFile(Rep, GENERIC_READ, FILE_SHARE_READ, NULL,OPEN_EXISTING, 0, NULL);
FILETIME ftCreate, ftAccess, ftWrite;
SYSTEMTIME stUTC, stLocal;
if (!GetFileTime(hFile, &ftCreate, &ftAccess, &ftWrite))
return -1;
// VIRE car retourne souvent -1 sans raison Xa sept 2016
FileTimeToSystemTime(&ftAccess, &stUTC);
SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);
CloseHandle(hFile);
*/
// CFileFind C;
CFileFind2 C;
CTime T;
C.FindFile(Rep, 0);
C.FindNextFile(); // bug system 18 oct 2016 À faire : gestion des exceptions ?
// C.GetCreationTime(T);
C.GetLastWriteTime(T);
*Jour = T.GetDay();
*Mois = T.GetMonth();
*An = T.GetYear(); // semble marcher 7/9/16
// *Jour = stLocal.wDay;
// *Mois = stLocal.wMonth;
// *An = stLocal.wYear;
C.Close(); // ferme recherche
C.CloseContext(); // ferme fichier (est-il ouvert ?)
FILE* in = fopen(Rep,"r");
if(in)
{
...
Has anyone an idea ?
Many thanks for reading and maybe answering.
Xavier
这篇关于void CFileFind :: AssertValid()const TROUBLES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!