-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC_File_System.hpp
More file actions
70 lines (51 loc) · 1.98 KB
/
C_File_System.hpp
File metadata and controls
70 lines (51 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//////////////////////////////////////////////////////////////////////////////////
// [ File_System_Class_Header ]
//////////////////////////////////////////////////////////////////////////////////
//
//
// [::Last modi: 03.10.16 L.ey (µ~)::]
//
//
// [::alpha 0.1]
//
#ifndef _C_FILE_SYSTEM_H_
#define _C_FILE_SYSTEM_H_
#include <iostream>
#include <fstream>
using namespace std;
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/types.h>
#include <unistd.h>
#include <dirent.h>
#include "C_DArray.hpp"
//////////////////////////////////////////////////////////////////////////////////
static const int C_FILE_SYSTEM_READY = 0x01;
static const int C_FILE_SYSTEM_ERROR = 0x00;
//////////////////////////////////////////////////////////////////////////////////
class C_File_System {
public:
C_File_System(){};
~C_File_System(){};
//////////////////////////////////
int dir(char* psPath, C_DArray* pDA_Folder, C_DArray* pDA_File);
int makedir(const char* psPath, mode_t mode);
int deldir(const char* psPath);
int copyfile(const char* psSource, const char* psDest);
int delfile(const char* psPath);
int movefile(const char* psSource, const char* psDest);
//////////////////////////////////
// (r) == recursion
int rdir(char* psPath, C_DArray* pDA_Folder, C_DArray* pDA_File);
int rcopydir(char* psSource, char* psDest);
int rmovedir(char* psSource, char* psDest);
int rdeldir(char* psSource);
int getrdirsize(char* psPath, unsigned long* pSize);
protected:
int rmakedir(C_DArray* pDAFolder);
int rcopyfile(C_DArray* pDA_Source, C_DArray* pDA_Dest);
int rdelfile(C_DArray* pDA_File);
int rdeletedir(C_DArray* pDA_Folder);
int getfreespace(char* psPath, unsigned long* pFree);
};
#endif // _C_FILE_SYSTEM_H_