[Winpcap-users] Offline capture opening path with spaces (Windows)

Stefan Billeb stefan.billeb at atip.de
Fri May 4 00:36:50 PDT 2012


Hello Everybody,

I am developing with jNetPcap on Java which is (most of you will know) a 
wrapper for winpcap.

When I try to open an offline capture pcap file and the path to the file 
contains whitespaces an exception is thrown and it cannot get opened.

I already discussed the Problem on jNetPcap Support but they advised me 
to contact the winpcap mailing list to get help.

Anyhow, is it possible to open files with paths containing whitespaces? 
Usually wrapping them with quotes "" did not work either.

// code snippet
final StringBuilder errbuf = new StringBuilder();

         Pcap pcap = Pcap.openOffline(filename, errbuf);

         if(pcap == null) {
             System.err.printf("Error while opening device for capture: "
                     + errbuf.toString());

             return false;
         }

//

Thanks in advance,

Stefan

-- 
Stefan Billeb
Software Engineer



More information about the Winpcap-users mailing list