Pingas Posted August 7, 2020 Share Posted August 7, 2020 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
devrom Posted August 7, 2020 Share Posted August 7, 2020 (edited) 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 August 7, 2020 by ipg_rom 1 Link to comment
Pingas Posted August 10, 2020 Author Share Posted August 10, 2020 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
silent Posted August 11, 2020 Share Posted August 11, 2020 You also can use FileSystem::getAbsolutePath(virtual_path) to get the absolute real path. Is that enough for your use-case? How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts