• Post Reply Bookmark Topic Watch Topic
  • New Topic

tshark not giving any output  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written the following code to run tshark from java.



The output is

pcap_path = D:\sangeeta\experiment\ISCX\June-11\New Folder\testbed-11jun.pcap

file_path = D:\sangeeta\experiment\ISCX\June-11\New Folder\june-11\june-11-icmp.txt

[C:\program files\wireshark\tshark.exe, -T, fields, -n, -r, D:\sangeeta\experime
nt\ISCX\June-11\New Folder\testbed-11jun.pcap, -E, separator=,, -e, frame.number
, -e, frame.time_epoch, -e, icmp.resptime, >, D:\sangeeta\experiment\ISCX\June-1
1\New Folder\june-11\june-11-icmp.txt]


But the file icmp.txt is empty. Tshark is not writing anything to the file icmp.txt

Please help.

Your help will be highly appreciated.

Thanks.


Puglu
 
Ranch Hand
Posts: 65
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Puglu, welcome to JavaRanch!

Please use code tags on your post so to make your code readable. Thanks.
 
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are trying to redirect the output to a file using

which requires that cmd.exe is used to run the process. This is just one of the traps described in "the traps" article. Although the article is aimed at Runtime.exec() the traps are applicable to the Process objects created by ProcessdBuilder. You seem to have fallen for at least 4 of the traps.
 
puglu bhattacharya
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply. I will try to solve and get back.
 
puglu bhattacharya
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved the problem. Thank you very much Mr. Richard Tookey for the guideline.

Myyron Murray Latorilla I will use code tags from next time onwards. Thanks for the suggestion.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!