Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Wireshark / Ubuntu solution for _findfirst, _findnext, ...

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 15 Apr 2016 01:19:35 -0700
On Apr 15, 2016, at 1:06 AM, FIXED-TERM Scholz Tobias (DC-IA/EAI3) <fixed-term.Tobias.Scholz@xxxxxxxxxxxxxxx> wrote:

> as my development needs to use file functions like _findfirst, _findnext and _findclose

...it will, therefore, not work on any UN*X, as those are not UN*X functions.

If, however, your development were, instead, to need to use g_dir_open():

	https://developer.gnome.org/glib/stable/glib-File-Utilities.html#g-dir-open

g_dir_read_name():

	https://developer.gnome.org/glib/stable/glib-File-Utilities.html#g-dir-read-name

and g_dir_close():

	https://developer.gnome.org/glib/stable/glib-File-Utilities.html#g-dir-close

then it would work on Windows and on various UN*Xes.

Those are what Wireshark code uses when it needs to scan a directory.

Those functions will *not* do wildcard matching; they will return all file names found in the directory.

Those functions will, at least on UN*X, return "." and ".." as file names in a directory; you almost certainly want to ignore those two names.

They return file names that are not guaranteed to be in UTF-8; they'll be in UTF-8 on Windows and on any UN*X in which file names are, when read by the file system code and supplied to userland, in UTF-8.