|
|
@@ -20,146 +20,7 @@
|
|
|
#include "EventCode.h"
|
|
|
#endif // RVC_OS_WIN
|
|
|
|
|
|
-
|
|
|
using namespace std;
|
|
|
-//获取文件夹实际路径
|
|
|
-//static ErrorCodeEnum expand_dir(IEntityFunction *pEntityFunc, const char *str, CSimpleStringA &out)
|
|
|
-//{
|
|
|
-// ErrorCodeEnum Error = Error_Unexpect;
|
|
|
-// if (str) {
|
|
|
-// const char *p = str;
|
|
|
-// const char *sfirst;
|
|
|
-// int first = 0;
|
|
|
-// char tmp[1024];
|
|
|
-// int k = 0;
|
|
|
-// while (*p) {
|
|
|
-// if (first) {
|
|
|
-// if (*p == ')') {
|
|
|
-// char key[MAX_PATH];
|
|
|
-// key[0] = 0;
|
|
|
-// CSimpleStringA strKeyPath;;
|
|
|
-// memcpy(key, sfirst, p - sfirst);
|
|
|
-// key[p-sfirst] = 0;
|
|
|
-// Error = pEntityFunc->GetPath(key, strKeyPath);
|
|
|
-// if (Error != Error_Succeed) {
|
|
|
-// //Dbg("sys path $(%s)$ cannot evaluate!", key);
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("expand_dir")("sys path $(%s)$ cannot evaluate!", key);
|
|
|
-// return Error;
|
|
|
-// }
|
|
|
-// strcpy(&tmp[k], (LPCSTR)strKeyPath);
|
|
|
-// k += strKeyPath.GetLength();
|
|
|
-// first = 0;
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// if (*p == '$' && *(p+1) == '(') {
|
|
|
-// p++;
|
|
|
-// first = 1;
|
|
|
-// sfirst = p+1;
|
|
|
-// } else {
|
|
|
-// tmp[k++] = *p;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// p++;
|
|
|
-// }
|
|
|
-// if (k != 0) {
|
|
|
-// tmp[k] = 0;
|
|
|
-// out = tmp;
|
|
|
-// return Error_Succeed;
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// return Error_Param;
|
|
|
-// }
|
|
|
-// return Error;
|
|
|
-//}
|
|
|
-
|
|
|
-//static upload_dir_t *upload_dir_load(IEntityFunction *pEntityFunc, const char *dir, int default_silent_time, int default_limitation)
|
|
|
-//{
|
|
|
-// upload_dir_t *updir = ZALLOC_T(upload_dir_t);
|
|
|
-// if (updir)
|
|
|
-// {
|
|
|
-// CSimpleStringA str;
|
|
|
-//
|
|
|
-// std::map<std::string, std::string> macroPath;
|
|
|
-// macroPath["SysLog"] = "$(SysLog)"; //TODO
|
|
|
-// macroPath["InterLog"] = "$(InterLog)"; //TODO
|
|
|
-// macroPath["Photo"] = "$(UploadPhoto)";
|
|
|
-// macroPath["Video"] = "$(UploadVideo)";
|
|
|
-// macroPath["SilverlightDebug"] = "$(slv)"; //TODO
|
|
|
-// macroPath["Debug"] = "$(dbg)";
|
|
|
-//
|
|
|
-// std::map<std::string, bool> macroZip;
|
|
|
-// macroZip["SysLog"] = true;
|
|
|
-// macroZip["InterLog"] = true;
|
|
|
-// macroZip["Photo"] = false;
|
|
|
-// macroZip["Video"] = false;
|
|
|
-// macroZip["SilverlightDebug"] = true;
|
|
|
-// macroZip["Debug"] = true;
|
|
|
-//
|
|
|
-// ErrorCodeEnum Error = Error_Succeed;
|
|
|
-// if (macroPath.find(dir) == macroPath.end()) {
|
|
|
-// return updir;
|
|
|
-// }
|
|
|
-// str = macroPath[dir].c_str();
|
|
|
-//
|
|
|
-// INIT_LIST_HEAD(&updir->candidate_list);
|
|
|
-// CSimpleStringA strRealPath;
|
|
|
-// Error = expand_dir(pEntityFunc, (LPCSTR)str, strRealPath);
|
|
|
-// if (Error == Error_Succeed) {
|
|
|
-// INIT_LIST_HEAD(&updir->candidate_list);
|
|
|
-// updir->name = _strdup(dir);
|
|
|
-// updir->path = _strdup(strRealPath);
|
|
|
-//
|
|
|
-// if (strcmp(dir, "Video") == 0) {
|
|
|
-// str = "$(LocalVideo)";
|
|
|
-// updir->flags |= UPLOAD_FLAG_MOVEPATH;
|
|
|
-// Error = expand_dir(pEntityFunc, str, strRealPath);
|
|
|
-// if (Error != Error_Succeed) {
|
|
|
-// return NULL;
|
|
|
-// }
|
|
|
-// updir->movepath = _strdup(strRealPath);
|
|
|
-// } else {
|
|
|
-// updir->flags |= UPLOAD_FLAG_AUTODELETE;
|
|
|
-// }
|
|
|
-// if (macroZip.find(dir) != macroZip.end() && macroZip[dir]) {
|
|
|
-// updir->flags |= UPLOAD_FLAG_ZIP;
|
|
|
-// }
|
|
|
-// if (strcmp("SilverlightDebug", dir) == 0 || strcmp("Debug", dir) == 0) {
|
|
|
-// updir->silent_time = 86400;
|
|
|
-// } else {
|
|
|
-// updir->silent_time = 900;
|
|
|
-// }
|
|
|
-// updir->child_count_limitation = default_limitation;
|
|
|
-// updir->fileCount = 0;//初始化设置为0
|
|
|
-// updir->fileLenSum = 0;//初始化设置为0
|
|
|
-// }
|
|
|
-// }
|
|
|
-// return updir;
|
|
|
-//}
|
|
|
-
|
|
|
-//初始化要上传的文件夹配置
|
|
|
-//int upload_create(struct list_head *list, IEntityFunction *pEntityFunc, CSimpleStringA &checkDir)
|
|
|
-//{
|
|
|
-// assert(list_empty(list));
|
|
|
-// char type_str[1024];
|
|
|
-// char *p, *c;
|
|
|
-// int default_silent_time = 3600;
|
|
|
-// int default_limitation = 256;
|
|
|
-// strcpy(type_str, "SysLog,InterLog,Photo,Video,SilverlightDebug,Debug");
|
|
|
-// p = strtok_s(type_str, ", ", &c);
|
|
|
-// while (p) {
|
|
|
-// upload_dir_t *dir = upload_dir_load(pEntityFunc, p, default_silent_time, default_limitation);
|
|
|
-// if (!dir)
|
|
|
-// {
|
|
|
-// return Error_Unexpect;
|
|
|
-// }
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("upload_create")("load %s ok", p);
|
|
|
-// list_add_tail(&dir->entry, list);
|
|
|
-// p = strtok_s(NULL, ", ", &c);
|
|
|
-// }
|
|
|
-// return 0;
|
|
|
-//}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
#ifdef RVC_OS_WIN
|
|
|
#define FT_2000_1_1_0_0_0 125911584000000000UL
|
|
|
@@ -202,20 +63,11 @@ static int check_zero_ref(const char *path)
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
#ifdef RVC_OS_WIN
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
-
|
|
|
int changeFileAtt(const char* path)
|
|
|
{
|
|
|
struct stat attr_of_del;
|