Function to obtain all files in a folder

It’s been a while since I last asked a question about GTK, but here we go.
For quite some time I’ve used this function to obtain a slist of GFIles contained in a folder.

I wrote it many years ago and it hasn’t worked regularly since then.
Sometimes it would work and sometimes it wouldn’t. The behavior is completely undefined.

What could be the reason for it to not work and more importantly how do I do this in a GTK fashion, because I don’t want to add platform-specific code?

Wow, that’s a pretty big hack just for this basic feature. So the function that does this is g_file_enumerate_children_async() (or the synchronous g_file_enumerate_children() one if you don’t mind having your UI freeze while listing the files), in GIO.


Oh, hahaha. Don’t know how I missed that.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.