I want to list all the file name in a directory, Is there any function available in unreal?
A lot of very similar questions asked there just use the search function :).
Also your question is very generic if you provide some more details maybe I can help more.
Let’s say I have more than 5 files(such as: Shape_Cone.uasset, Shape_Cube.uasset, and many more) in folder(/Game/StarterContent/Shapes/).
I’d like get the all file names and store in a FString array.
FindFiles( TArray<FString>& Result, const TCHAR* InFilename, bool Files, bool Directories )
- “*.uasset” as InFilename to filter out only .uasset files in this folder
there is a nice question about it with a possible solution for you:
FindFiles is using some path it searches for it seems, you can also find a question about it there. In above question the solution is to correcnt the path.
Thanks for your post. It helped me to learn about filemannger and I solved my problem with the help of below link
Hi! I found some code snippet, maybe it can help you
FString dir = FPaths::ProjectSavedDir(); FString fileExt = TEXT("sav"); IFileManager::Get().FindFiles(SaveFileNames, *dir, *fileExt);