fs/system rack: get entries filtered?

hi,

is there a way using the native rack filesystem library to getEntries filtering by a list of extensions? such as get all files/dirs of a path including only *mp3/*wav?

thanks

Rack system just uses ghc filesystem which is std filesystem

As long as you are careful with your string to path conversion as that example is (it uses fs::u8path) you can just use std filesystem functions even with 11

2 Likes

many thanks mr @baconpaul , this seems to works perfectly:

mScannedPathFiles.clear();
for (const auto &entry : fs::recursive_directory_iterator(fs::u8path(mPathCurrentDir))) {
	if (entry.is_regular_file() && entry.path().extension() == ".wav") {
		mScannedPathFiles.push_back(entry.path().generic_u8string());
	}
}

thanks :slight_smile:

2 Likes