-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_handling_functions.h
More file actions
22 lines (20 loc) · 949 Bytes
/
file_handling_functions.h
File metadata and controls
22 lines (20 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
/*
This file houses file handling helper functions
*/
#include "common.h"
//char* readNbytesFromOffset(int n,int offset);
//int writeNBytesToOffset(char* buffer,int n,int offset);
int writeDataBlockToFile(WholeFS*fs,char* blockBuffer,int existingfileSize, int index);
char* readDataBlockFromFile(WholeFS*fs, int index);
void writeInodeBlockToFile(WholeFS*fs,char* blockBuffer, int index);
char* readInodeBlockFromFile(WholeFS*fs, int index);
char* readSuperBlockFromFile(WholeFS*fs);
void writeSuperNodeBlockToFile(WholeFS*fs,char* blockBuffer);
void readSuperBlock(WholeFS* fs);
void writeSuperBlock(WholeFS* fs);
int writeEntireDataBlockToFile(WholeFS*fs,char* blockBuffer, int index);
int appendNbytesInDataBlockToFile(WholeFS*fs,char* blockBuffer,int off, int index,int n);
int writeInodeToFile(WholeFS* fs,Inode* inode,int inodeIndex);
#endif