upload.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef RVC_MOD_UPLOAD_UPLOAD_H_
  2. #define RVC_MOD_UPLOAD_UPLOAD_H_
  3. #include <list.h>
  4. #ifdef RVC_OS_WIN
  5. #else
  6. #include <sys/stat.h>
  7. #include <sys/types.h>
  8. #include <fcntl.h>
  9. #include <time.h>
  10. #include <stdio.h>
  11. #include <cstdio>
  12. #include <iostream>
  13. #endif
  14. typedef struct file_t file_t;
  15. typedef struct upload_dir_t upload_dir_t;
  16. struct file_t
  17. {
  18. struct list_head entry;
  19. char *path;
  20. char *name;
  21. unsigned int create_time;//距离2000年1月1日的流逝的秒数
  22. unsigned int length;
  23. upload_dir_t *owner;
  24. };
  25. #define UPLOAD_FLAG_AUTODELETE 0x01
  26. #define UPLOAD_FLAG_MOVEPATH 0x02
  27. #define UPLOAD_FLAG_ZIP 0x04
  28. // from ini config
  29. struct upload_dir_t {
  30. struct list_head entry;
  31. char *name;
  32. char *path;
  33. int flags;//自动删除|移动|压缩
  34. char *movepath;
  35. struct list_head candidate_list;//需要上传文件的集合
  36. int silent_time; // sec
  37. int child_count_limitation;
  38. int fileCount;//增加lwt 当前文件的个数
  39. int fileLenSum;//文件总长度 单位是k
  40. };
  41. #ifdef RVC_OS_WIN
  42. #else
  43. int changeFileAtt(const char* path);
  44. long getLinuxFileCTime(const char* fileName);
  45. #endif // RVC_OS_WIN
  46. #endif // RVC_MOD_UPLOAD_UPLOAD_H_