add : struct of inode, bloc and disk
This commit is contained in:
parent
87f340eec1
commit
277cfd923d
@ -1 +1,8 @@
|
||||
#define BUFSIZE 1024
|
||||
#define BUFSIZE 1024
|
||||
#define MAX_BLOCS_PER_INODE 30
|
||||
#define MAX_BYTES_PER_BLOC 1024
|
||||
|
||||
#define FILE 0
|
||||
#define BINARY 1
|
||||
#define DIRECTORY 2
|
||||
#define SYMBOLIC_LINK 3
|
||||
20
src/struct.h
Normal file
20
src/struct.h
Normal file
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "const.h"
|
||||
|
||||
typedef struct inode {
|
||||
char perms[8]; // rwxrwxrwx
|
||||
char filetype; // d, -, l
|
||||
int blocs[MAX_BLOCS_PER_INODE];
|
||||
} inode;
|
||||
|
||||
typedef struct bloc {
|
||||
char datas[MAX_BYTES_PER_BLOC];
|
||||
} bloc;
|
||||
|
||||
typedef struct disk {
|
||||
inode inodes[10];
|
||||
bloc blocs[30];
|
||||
} disk;
|
||||
|
||||
// pour 10 inode qui a 30 blocs de chacun 1024 octets, on a 307200 octets, soit
|
||||
// 307,2 Ko sur le disque
|
||||
Loading…
Reference in New Issue
Block a user