-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileControlBlock.h
More file actions
47 lines (39 loc) · 1.24 KB
/
FileControlBlock.h
File metadata and controls
47 lines (39 loc) · 1.24 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
/**************************************************************
* Class:: CSC-415-02 Spring 2024
* Name:: Tushin Kulshreshtha, Hayden Coke, Eric Khuong,
* Thanh Duong
* Student IDs:: 922180763, 921741974, 923406338, 922438176
* GitHub-Name:: Dextron04, crowcode17, ekhuong, DanielDoubleDx
* Group-Name:: Something Simple
* Project:: Basic File System
*
* File:: FileControlBlock.h
*
* Description:: This file defines structures for managing file information
* and buffering during file operations.
*
**************************************************************/
#ifndef _FILE_CONTROL_BLOCK_H
#define _FILE_CONTROL_BLOCK_H
#include <stdbool.h>
#include "DirectoryEntry.h"
typedef struct fileInfo {
char filename[239];
int fileSize;
int location;
DirectoryEntry * parent;
int index;
} fileInfo;
typedef struct b_fcb {
fileInfo * fi;
char * buffer; // holds the open file buffer
int bufferIndex; // holds the current position in the buffer
bool isDirty; // keeps track of whether or not the buffer is valid
int fileDescriptor; // "magic number"
int currentBlock; // keeps track of which block the file is on
int preAllocatedBlocks;
int flag;
int extraBlocks; // extra block allocation ; just for Eric
int maxFilePos;
} b_fcb;
#endif