mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 11:26:56 +02:00
common: remove unused recursive file enumeration (#681)
common: don't follow reparse points in the Windows recursive file walk SysFileFindFiles recurses into every entry carrying FILE_ATTRIBUTE_DIRECTORY, which on Windows includes directory symlinks and junctions. A junction pointing at one of its own ancestors makes the walk recurse until the stack runs out. The Linux implementation already guards against this: it uses lstat rather than stat specifically so a symlink is never followed into a cycle. Skip reparse-point entries on Windows for the same reason. Co-authored-by: nmzik <Nmzik@mail.ru>
This commit is contained in:
@@ -30,14 +30,6 @@ class File {
|
||||
public:
|
||||
enum class Mode { Read, Write, ReadWrite, WriteRead };
|
||||
|
||||
struct FindInfo {
|
||||
std::filesystem::path path_with_name;
|
||||
std::filesystem::path rel_path_with_name;
|
||||
DateTime last_access_time;
|
||||
DateTime last_write_time;
|
||||
uint64_t size;
|
||||
};
|
||||
|
||||
struct DirEntry {
|
||||
std::string name;
|
||||
bool is_file;
|
||||
@@ -98,7 +90,6 @@ public:
|
||||
static bool SetLastAccessAndWriteTimeUTC(const std::filesystem::path& name,
|
||||
const DateTime& access, const DateTime& write);
|
||||
|
||||
static std::vector<FindInfo> FindFiles(const std::filesystem::path& path);
|
||||
static std::vector<DirEntry> GetDirEntries(const std::filesystem::path& path);
|
||||
static bool CopyFile(const std::filesystem::path& src, const std::filesystem::path& dst);
|
||||
static bool RenameFile(const std::filesystem::path& src, const std::filesystem::path& dst);
|
||||
|
||||
Reference in New Issue
Block a user