syscalls: improve working with files using vfs
This commit is contained in:
+3
-10
@@ -28,21 +28,14 @@ void apply_pic_masks()
|
||||
|
||||
void test_iso9660()
|
||||
{
|
||||
l9660_dir g_root_dir;
|
||||
l9660_file g_test_file;
|
||||
|
||||
l9660_status status;
|
||||
// 2. Open the root directory
|
||||
status = l9660_fs_open_root(&g_root_dir, &global_fs);
|
||||
if (status != L9660_OK) {
|
||||
printf("Error opening root directory!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Files in root directory:\n");
|
||||
for (;;) {
|
||||
l9660_dirent *dent;
|
||||
status = l9660_readdir(&g_root_dir, &dent);
|
||||
status = l9660_readdir(root_dir, &dent);
|
||||
|
||||
if (dent == NULL || status != L9660_OK) {
|
||||
break; // End of directory or error
|
||||
@@ -58,11 +51,11 @@ void test_iso9660()
|
||||
printf("\nReading content of /TEST.TXT:\n");
|
||||
|
||||
// Re-open the root directory to reset its position before searching
|
||||
l9660_fs_open_root(&g_root_dir, &global_fs);
|
||||
l9660_fs_open_root(root_dir, global_fs);
|
||||
|
||||
l9660_dir boot_dir;
|
||||
l9660_dir grub_dir;
|
||||
status = l9660_opendirat(&boot_dir, &g_root_dir, "boot");
|
||||
status = l9660_opendirat(&boot_dir, root_dir, "boot");
|
||||
printf("STATUS %X\n", status);
|
||||
status = l9660_opendirat(&grub_dir, &boot_dir, "grub");
|
||||
printf("STATUS %X\n", status);
|
||||
|
||||
Reference in New Issue
Block a user