Wireshark mailing list archives

Re: Wireshark / Ubuntu solution for _findfirst, _findnext, ...


From: Guy Harris <guy () alum mit edu>
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 () boschrexroth de> 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.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: