Jump to content

FileSystem, How to read files from a subfolder


photo

Recommended Posts

Let's imagine we have a mount point "test". It has a subfolder "test/subfolder". The question is: how can I enumerate all files in this subfolder? I tried to use Unigine::FileSystem::getMount("test/subfolder") and mount->getVirtualFiles() but it seems to return "test" mount point so I get all the files in the mount. How can get files from subfolder only?

Link to comment

Hey Pingas,

you could use getDataPath to get the absolute path to your mounted folder, concatenate the subfolder and then use a library like Qt.
The Dir class could also work, but I am not sure  because  I did not use it yet. Instantiate it and iterate over the number of files.

Best regards

Edited by ipg_rom
  • Like 1
Link to comment
On 8/7/2020 at 6:01 PM, ipg_rom said:

Hey Pingas,

you could use getDataPath to get the absolute path to your mounted folder, concatenate the subfolder and then use a library like Qt.
The Dir class could also work, but I am not sure  because  I did not use it yet. Instantiate it and iterate over the number of files.

Best regards

Thanks for suggestions! But the main problem is that I have to enumerate files from a virtual subfolder. Dir class or any other means for filesystem access doesn't help.

Link to comment
×
×
  • Create New...