[PR #3455] [MERGED] Filesystem: Abstract handling of directory files #3481

Closed
opened 2026-02-27 22:03:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3455
Author: @StevenMiller123
Created: 8/24/2025
Status: Merged
Merged: 8/25/2025
Merged by: @georgemoralis

Base: mainHead: abstract-directories


📝 Commits (10+)

📊 Changes

28 files changed (+727 additions, -196 deletions)

View changed files

📝 CMakeLists.txt (+22 -16)
📝 src/core/file_sys/devices/base_device.cpp (+1 -1)
📝 src/core/file_sys/devices/base_device.h (+6 -6)
📝 src/core/file_sys/devices/console_device.cpp (+4 -4)
📝 src/core/file_sys/devices/console_device.h (+4 -4)
📝 src/core/file_sys/devices/deci_tty6_device.cpp (+4 -4)
📝 src/core/file_sys/devices/deci_tty6_device.h (+4 -4)
📝 src/core/file_sys/devices/ioccom.h (+1 -1)
📝 src/core/file_sys/devices/logger.cpp (+2 -2)
📝 src/core/file_sys/devices/logger.h (+2 -2)
📝 src/core/file_sys/devices/nop_device.h (+4 -4)
📝 src/core/file_sys/devices/random_device.cpp (+4 -4)
📝 src/core/file_sys/devices/random_device.h (+4 -4)
📝 src/core/file_sys/devices/srandom_device.cpp (+4 -4)
📝 src/core/file_sys/devices/srandom_device.h (+4 -4)
📝 src/core/file_sys/devices/urandom_device.cpp (+4 -4)
📝 src/core/file_sys/devices/urandom_device.h (+4 -4)
src/core/file_sys/directories/base_directory.cpp (+15 -0)
src/core/file_sys/directories/base_directory.h (+52 -0)
src/core/file_sys/directories/normal_directory.cpp (+140 -0)

...and 8 more files

📄 Description

Based on similar work done for device files in the past, this PR separates directory file-related code into separate classes, designed to handle the different types of directories present on a real PS4.

This PR adds cross-platform support for read and lseek operations on directories, and fixes remaining inaccuracies with getdents behavior. I've also touched up a few issues in likernel filesystem code while I was there.

So far I've got two types of folders implemented, based on the two types I've seen while testing, but the code leaves room for additional directory types if those become necessary.

In my testing, this fixes IxSHE Tell (CUSA17112) and anywhereVR (CUSA08643) crashing on startup for Windows devices, and fixes a regression in updated versions of Final Fantasy XV (CUSA01633) caused by #3416


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3455 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 8/24/2025 **Status:** ✅ Merged **Merged:** 8/25/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `abstract-directories` --- ### 📝 Commits (10+) - [`9a223e6`](https://github.com/shadps4-emu/shadPS4/commit/9a223e6cca0bd51acdb439c35f4295f70abf65ef) Rename SceKernelIovec to OrbisKernelIovec - [`dfec236`](https://github.com/shadps4-emu/shadPS4/commit/dfec2367bf43da9c19ad6950e2bd3fac942a8d01) Type fixups - [`95dd0e0`](https://github.com/shadps4-emu/shadPS4/commit/95dd0e0ff6a833fa754502479484a8edcbec1951) More type fixups - [`dd6541f`](https://github.com/shadps4-emu/shadPS4/commit/dd6541fc5e4e5719e6562f4e9c3fc53482a1b70d) Update file_system.cpp - [`1eebd1e`](https://github.com/shadps4-emu/shadPS4/commit/1eebd1e7ae53a24dabe76f5918736472ad09ed42) Abstract directory handling - [`d80efd9`](https://github.com/shadps4-emu/shadPS4/commit/d80efd918c013c2688d86ee1673283ddd0825ab8) Clang - [`3dbdda4`](https://github.com/shadps4-emu/shadPS4/commit/3dbdda4a5c9fb38103fe2be3a5b5ee2596e28ea2) Directory fstat - [`04cd8af`](https://github.com/shadps4-emu/shadPS4/commit/04cd8afbe6447f8c9df8f760d582db928ee6fe62) Fix dirent loading logic - [`caf4c5c`](https://github.com/shadps4-emu/shadPS4/commit/caf4c5ca7c589a37df55f7705876ae3e8436ab96) PfsDirectory size - [`88e66a9`](https://github.com/shadps4-emu/shadPS4/commit/88e66a9aee02bfc81826d902709aad9b80fb6914) GetDents cleanup ### 📊 Changes **28 files changed** (+727 additions, -196 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+22 -16) 📝 `src/core/file_sys/devices/base_device.cpp` (+1 -1) 📝 `src/core/file_sys/devices/base_device.h` (+6 -6) 📝 `src/core/file_sys/devices/console_device.cpp` (+4 -4) 📝 `src/core/file_sys/devices/console_device.h` (+4 -4) 📝 `src/core/file_sys/devices/deci_tty6_device.cpp` (+4 -4) 📝 `src/core/file_sys/devices/deci_tty6_device.h` (+4 -4) 📝 `src/core/file_sys/devices/ioccom.h` (+1 -1) 📝 `src/core/file_sys/devices/logger.cpp` (+2 -2) 📝 `src/core/file_sys/devices/logger.h` (+2 -2) 📝 `src/core/file_sys/devices/nop_device.h` (+4 -4) 📝 `src/core/file_sys/devices/random_device.cpp` (+4 -4) 📝 `src/core/file_sys/devices/random_device.h` (+4 -4) 📝 `src/core/file_sys/devices/srandom_device.cpp` (+4 -4) 📝 `src/core/file_sys/devices/srandom_device.h` (+4 -4) 📝 `src/core/file_sys/devices/urandom_device.cpp` (+4 -4) 📝 `src/core/file_sys/devices/urandom_device.h` (+4 -4) ➕ `src/core/file_sys/directories/base_directory.cpp` (+15 -0) ➕ `src/core/file_sys/directories/base_directory.h` (+52 -0) ➕ `src/core/file_sys/directories/normal_directory.cpp` (+140 -0) _...and 8 more files_ </details> ### 📄 Description Based on similar work done for device files in the past, this PR separates directory file-related code into separate classes, designed to handle the different types of directories present on a real PS4. This PR adds cross-platform support for `read` and `lseek` operations on directories, and fixes remaining inaccuracies with `getdents` behavior. I've also touched up a few issues in likernel filesystem code while I was there. So far I've got two types of folders implemented, based on the two types I've seen while testing, but the code leaves room for additional directory types if those become necessary. In my testing, this fixes IxSHE Tell (CUSA17112) and anywhereVR (CUSA08643) crashing on startup for Windows devices, and fixes a regression in updated versions of Final Fantasy XV (CUSA01633) caused by #3416 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:51 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3481
No description provided.