-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfile.h
37 lines (27 loc) · 803 Bytes
/
file.h
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
#ifndef FILE_H
#define FILE_H
typedef struct FileTableEntry
{
int fileDescriptor;
int inodePointer;
int filePointer;
int sizeOfFile;
int isValid;
char fileName[16];
char filePath[256];
} FileTableEntry;
int addFile(int parentInode, char* fileName);
int CreateFileTable();
int getAvailabeFileDescriptor();
int SizeOfFile(int inodeNumber);
int DataBlocksOccupiedByFile(int inodeNumber,int* sectorNumbers);
int openFileDescriptor(char *path);
int isFileOpen(int fd);
int removeFileTableEntry(int fd);
int getInodePointerOfFileEntry(int fd);
int updateFilePointerOfFileEntry(int fd, int filePointer);
int FileRead(int fd, char *buffer, int size);
int FileWrite(int fd, char* buffer , int size);
void printFileTableEntry(int fd);
void printFileTable();
#endif // FILE_H