From ac581563be29c07e88b747358e1879f4bde697e7 Mon Sep 17 00:00:00 2001
From: Bah Thierno-Souleymane <thiernosouleymane.bah.etu@univ-lille.fr>
Date: Fri, 19 Mar 2021 08:06:49 +0100
Subject: [PATCH] feat(write bloc funtion done)

---
 tpfs/vol.c | 6 ++++++
 tpfs/vol.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/tpfs/vol.c b/tpfs/vol.c
index 4379f60..c177583 100644
--- a/tpfs/vol.c
+++ b/tpfs/vol.c
@@ -65,4 +65,10 @@ void read_bloc(unsigned int vol, unsigned int nbloc, unsigned char *buffer)
 {
     int sector_cylinder[2] = get_sector_cylinder(vol, nbloc); // [sector, cylinder]
     read_sector(buffer, sector_cylinder[1], sector_cylinder[0]);
+}
+
+void write_bloc(unsigned int vol, unsigned int nbloc, const unsigned char *buffer)
+{
+    int sector_cylinder[2] = get_sector_cylinder(vol, nbloc); // [sector, cylinder]
+    write_sector(sector_cylinder[1], sector_cylinder[0], buffer);
 }
\ No newline at end of file
diff --git a/tpfs/vol.h b/tpfs/vol.h
index 29eb93a..9966fc1 100644
--- a/tpfs/vol.h
+++ b/tpfs/vol.h
@@ -32,5 +32,6 @@ void load_mbr(void);
 void save_mbr(void);
 unsigned int *get_sector_cylinder(int volume, int bloc);
 void read_bloc(unsigned int vol, unsigned int nbloc, unsigned char *buffer);
+void write_bloc(unsigned int vol, unsigned int nbloc, const unsigned char *buffer);
 
 #endif // VOL_H
-- 
GitLab