|
@@ -1,12 +1,12 @@
|
|
|
#include "stdafx.h"
|
|
|
#include "SpBase.h"
|
|
|
-#include "SpIni.h"
|
|
|
+//#include "SpIni.h"
|
|
|
#include "upload.h"
|
|
|
-#include <memutil.h>
|
|
|
+//#include <memutil.h>
|
|
|
#include <fileutil.h>
|
|
|
-#include <array.h>
|
|
|
-#include <string>
|
|
|
-#include "sstream"
|
|
|
+//#include <array.h>
|
|
|
+//#include <string>
|
|
|
+//#include "sstream"
|
|
|
#ifdef RVC_OS_WIN
|
|
|
|
|
|
#include "XZip.h"
|
|
@@ -31,46 +31,6 @@ using namespace std;
|
|
|
|
|
|
#endif // RVC_OS_WIN
|
|
|
|
|
|
-static int check_zero_ref(const char *path)
|
|
|
-{
|
|
|
-#ifdef RVC_OS_WIN
|
|
|
- HANDLE hFile = CreateFileA(path,
|
|
|
- GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); // try open
|
|
|
- if (hFile != INVALID_HANDLE_VALUE) {
|
|
|
- CloseHandle(hFile);
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
- else {
|
|
|
- //LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_UPLOAD_SCANFILE_LOCK_ERROR, CSimpleStringA::Format("check_zero_ref is fail:%s",path).GetData());
|
|
|
- DWORD dwRet = GetLastError();
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-#else
|
|
|
- //后期改为linux真正的文件锁,现在来看,暂时用不着
|
|
|
- FILE* fp = fopen(path, "rb");
|
|
|
- if (fp != NULL) {
|
|
|
- fclose(fp);
|
|
|
- return true;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //Dbg("try open file fail :%s",path);
|
|
|
- //LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_UPLOAD_SCANFILE_LOCK_ERROR, CSimpleStringA::Format("check_zero_ref is fail:%s",path).GetData());
|
|
|
- return false;
|
|
|
- }
|
|
|
-#endif // RVC_OS_WIN
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
#ifdef RVC_OS_WIN
|
|
|
|