forked from Rodrig79/Project-3-A-Simple-Network-File-System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileSys.cpp
More file actions
81 lines (64 loc) · 1.42 KB
/
Copy pathFileSys.cpp
File metadata and controls
81 lines (64 loc) · 1.42 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
71
72
73
74
75
76
77
78
79
80
// CPSC 3500: File System
// Implements the file system commands that are available to the shell.
#include <cstring>
#include <iostream>
#include <unistd.h>
using namespace std;
#include "FileSys.h"
#include "BasicFileSys.h"
#include "Blocks.h"
// mounts the file system
void FileSys::mount(int sock) {
bfs.mount();
curr_dir = 1; //by default current directory is home directory, in disk block #1
fs_sock = sock; //use this socket to receive file system operations from the client and send back response messages
}
// unmounts the file system
void FileSys::unmount() {
bfs.unmount();
close(fs_sock);
}
// make a directory
void FileSys::mkdir(const char *name)
{
}
// switch to a directory
void FileSys::cd(const char *name)
{
}
// switch to home directory
void FileSys::home() {
}
// remove a directory
void FileSys::rmdir(const char *name)
{
}
// list the contents of current directory
void FileSys::ls()
{
}
// create an empty data file
void FileSys::create(const char *name)
{
}
// append data to a data file
void FileSys::append(const char *name, const char *data)
{
}
// display the contents of a data file
void FileSys::cat(const char *name)
{
}
// display the first N bytes of the file
void FileSys::head(const char *name, unsigned int n)
{
}
// delete a data file
void FileSys::rm(const char *name)
{
}
// display stats about file or directory
void FileSys::stat(const char *name)
{
}
// HELPER FUNCTIONS (optional)