From 196b33bb7f6b04d42c36bf459b675233b34604ec Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Tue, 6 Aug 2019 17:42:43 +0100 Subject: PSP: Implement AbstractFSNode::createDirectory() --- backends/fs/psp/psp-fs.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'backends/fs') diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp index e79d07d64a..34727a6392 100644 --- a/backends/fs/psp/psp-fs.cpp +++ b/backends/fs/psp/psp-fs.cpp @@ -240,7 +240,21 @@ Common::WriteStream *PSPFilesystemNode::createWriteStream() { } bool PSPFilesystemNode::createDirectory() { - warning("PSPFilesystemNode::createDirectory(): Not supported"); + DEBUG_ENTER_FUNC(); + + if (PowerMan.beginCriticalSection() == PowerManager::Blocked) + PSP_DEBUG_PRINT_FUNC("Suspended\n"); // Make sure to block in case of suspend + + PSP_DEBUG_PRINT_FUNC("path [%s]\n", _path.c_str()); + + if (sceIoMkdir(_path.c_str(), 0777) == 0) { + struct stat st; + _isValid = (0 == stat(_path.c_str(), &st)); + _isDirectory = S_ISDIR(st.st_mode); + } + + PowerMan.endCriticalSection(); + return _isValid && _isDirectory; } -- cgit v1.2.3