ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] 2.1.0 - 'prefs_register_directory_preference' returns wrong path

From: "FIXED-TERM Scholz Tobias (DC-IA/EAI)" <fixed-term.Tobias.Scholz@xxxxxxxxxxxxxxx>
Date: Fri, 12 Feb 2016 08:35:54 +0000
In my dissector, a user has to define a network path, in which some text files are saved. Therefore I am using the function ‘prefs_register_directory_preference( )’ to get the path to a folder.
I also searched for the difference between UNIX and WIN network path names and noticed, that WIN uses the backslashes (e.g.: ‘D:\Development\...’ ) and UNIX the slashes (e.g.: ‘…/Development/…’ ).
Before using Wireshark 2.1.0 everything was fine with this functionality. The path was correctly been given to the program, for example for my windows pc ‘D:\Development\files’ (backslashes). Since I have upgraded my patch up to Wireshark 2.1.0, I still use the same function, but in comparison, Wireshark now returns for the same machine ‘D:/Development/files’ (slashes).
Even the protocol ‘MATE’ also uses the preference functionality , to define the path to a special file. But also there, the same problem appears.
For explanation:
I am using this path, to find several different files in this folder, which are including important information for my dissector. Therefore I add (depending on the operating system)  \<filename> for WIN or /<filename> to open the file and to search for the information in it. But getting the path ‘D:/Development/files’ from Wireshark I’m adding for my windows pc \<filename>, which gives me the total path to the file ‘D:/Development/files\<filename>’.
Does someone have the same problems and a solution for it or is there anything I forgot due to the new version of Wireshark?
T. Scholz