<html><div style='background-color:'><DIV class=RTE>Hi,</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>I'm student and I'm starting use differents functions of WinPcap. </DIV>
<DIV class=RTE>I've a problem when I try to open a pcap file like it's show in Readfile_ex.</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>It is possible to choose which file we want to open? And the directory where the file is?</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>I try to use this: but it doesnt't work!</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE><STRONG>printf("Which file would you like to open?\n");<BR>fgets(reinterpret_cast<char *> (* argv), 100, stdin); </STRONG></DIV>
<DIV class=RTE><STRONG></STRONG> </DIV>
<DIV class=RTE><STRONG> /* Open the capture file */<BR> if ((fp= pcap_open_offline(reinterpret_cast<const char *>(*argv), <BR> errbuf // error buffer<BR> )) == NULL)<BR> {<BR> fprintf(stderr,"\nUnable to open the file %s.\n", *argv);<BR> return -1;<BR> }</STRONG></DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>However, if I do this, it works!!</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE><STRONG>*argv ="save";</STRONG></DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>
<DIV class=RTE><STRONG> /* Open the capture file */<BR> if ((fp= pcap_open_offline(reinterpret_cast<const char *>(*argv), <BR> errbuf // error buffer<BR> )) == NULL)<BR> {<BR> fprintf(stderr,"\nUnable to open the file %s.\n", *argv);<BR> return -1;<BR> }</STRONG></DIV></DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>Maybe someone tried to do this already!!!</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>Thanks you§</DIV></div><br clear=all><hr>MSN Hotmail <a href="http://g.msn.com/8HMAFRFR/2746??PS=47575" target="_top">: créez votre adresse e-mail gratuite & à vie !</a> </html>