add : struct of inode, bloc and disk

This commit is contained in:
Guamss 2026-03-26 12:06:56 +01:00
parent 87f340eec1
commit 277cfd923d
2 changed files with 28 additions and 1 deletions

View File

@ -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
View 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