-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmount.cpp
More file actions
36 lines (27 loc) · 860 Bytes
/
mount.cpp
File metadata and controls
36 lines (27 loc) · 860 Bytes
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
#include <iostream>
#include <string>
#include "Logger.cpp"
#include "Mount_class.cpp"
using namespace std;
void setup_loop_device(const char* loopDevice, const char* imageFile) {
char command[256];
snprintf(command, sizeof(command), "losetup %s %s", loopDevice, imageFile);
// Выполняем команду
int result = system(command);
if (result == -1) {
cerr << "Error executing losetup: " << strerror(errno) << endl;
} else {
cout << "Successfully set up " << imageFile << " on " << loopDevice << endl;
}
}
int main()
{
Logger l = Logger("log.csv");
MountLinux mountLinux(l);
const char* m = "/mnt/img";
const char* i = "/mnt/ext4_image.img";
const char* n = "/dev/loop0";
//setup_loop_device(n, i);
mountLinux.umount_ext(m, i, n);
//mountLinux.mount_ext(m, i, n);
}