From 20d2ed09502f41519beb435a1300f2a57995c651 Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 7 Dec 2014 14:40:27 -0800 Subject: Make OpenDirectory fail if the directory doesn't exist This is in line with what the hardware itself does. It does this by splitting the initial directory opening into Directory.Open(), which will return false if a stat fails. Then, Archive::OpenDirectory will return nullptr, and archive.cpp will return an error code . --- src/core/file_sys/directory_romfs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core/file_sys/directory_romfs.h') diff --git a/src/core/file_sys/directory_romfs.h b/src/core/file_sys/directory_romfs.h index 4b71c4b13..e2944099e 100644 --- a/src/core/file_sys/directory_romfs.h +++ b/src/core/file_sys/directory_romfs.h @@ -19,6 +19,12 @@ public: Directory_RomFS(); ~Directory_RomFS() override; + /** + * Open the directory + * @return true if the directory opened correctly + */ + bool Open() override; + /** * List files contained in the directory * @param count Number of entries to return at once in entries -- cgit v1.2.3