First off, thank you for an excellent product. Then, to my problem; I need to programmatically obtain all available drives in the OS and to acquire a listing of the child items from a given directory.
I believe I’ve made a reasonable effort to search for some kind of tutorial but haven’t managed to find anything useful. Just when I thought I’d find something, like Rama’s excellent tutorials (someone give that man a medal already), the carpet gets pulled out from under me (GFileManager being discontinued).
I wanted to revert to the WinAPI but Rama’s comment “I have read that using System() is not such a good idea” made me hesitant: https://answers.unrealengine.com/questions/2711/how-to-open-os-file-browser-while-in-game-and-util.html
Engine/Source/Runtime/Core/Public/Misc/Paths.h is unfortunately not the solution I need.
Basically I’m trying to create an in-game file explorer with some basic file management functionality (copy, move, delete, etc.) but I can’t even list items in a directory or available drives (like Rama’s Slate Tree View here A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums). I tried using IPlatformFile::IterateDirectory or IPlatformFile::IterateDirectoryRecursively and their base- and sub classes but don’t know how to use IPlatformFile::FDirectoryVisitor.
Might I ask for just some basic code to get started with, please? Any explanation of which parts do what would be welcomed as well, but I’ll definitely by happy with just some code that can show me how to get all available drives and all child items in a folder/directory. A platform-neutral solution would also be awesome, but a Windows-only one would be welcome in itself. Alternatively, if you could even point me in the direction of a tutorial, that would be even better.
If you don’t mind me pushing my luck, please add a succint explanation on why it would be a bad idea to use the OS’s API for file management… or am I mistaken in that understanding?
Full disclosure: I’m self-taught and have, in the last year, changed from VB .NET to C#. I’ve started with some C++ tutorials especially for UE4 but I make no claim to being a C++ guru… yet. Which gives me the feeling that I’m setting myself up for an epic facepalm moment right now… but what the hell, as long as we’re learning, right?
Thanking you in advance,