Add a mode field to the dirent structure.

This commit is contained in:
David Given
2022-08-27 00:06:16 +02:00
parent f0ec8bd5b9
commit 8607f4af57
3 changed files with 5 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ public:
locked = bytes0[7] & 0x80;
length = ((bytes1[6] & 0x30) << 12) | (bytes1[5] << 8) | bytes1[4];
file_type = TYPE_FILE;
mode = locked ? "L" : "";
}
public:
@@ -66,6 +67,7 @@ public:
attributes["filename"] = dirent->filename;
attributes["length"] = fmt::format("{}", dirent->length);
attributes["type"] = "file";
attributes["mode"] = dirent->mode;
attributes["acorndfs.inode"] = fmt::format("{}", dirent->inode);
attributes["acorndfs.start_sector"] = fmt::format("{}", dirent->start_sector);
attributes["acorndfs.load_address"] = fmt::format("0x{:x}", dirent->load_address);

View File

@@ -32,6 +32,7 @@ public:
start_sector = br.read_be16();
length = br.read_8() * SECTOR_SIZE;
file_type = TYPE_FILE;
mode = "";
}
public:
@@ -75,6 +76,7 @@ public:
attributes["filename"] = dirent->filename;
attributes["length"] = fmt::format("{}", dirent->length);
attributes["type"] = "file";
attributes["mode"] = dirent->mode;
attributes["brother120.inode"] = fmt::format("{}", dirent->inode);
attributes["brother120.start_sector"] = fmt::format("{}", dirent->start_sector);
attributes["brother120.type"] = fmt::format("{}", dirent->brother_type);

View File

@@ -21,6 +21,7 @@ struct Dirent
std::string filename;
FileType file_type;
uint64_t length;
std::string mode;
};
enum FilesystemStatus