467,145 Members | 1,026 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,145 developers. It's quick & easy.

pipe output to a perl script


I currently have an application in perl that starts a text based torrent client, once I give the necessary parameters to the torrent.exe it will start printing out the following information and of course downloading the files.

saving: Images (12680.2 MB)
percent done: 4.8
time left: checking existing data download
to: q:\Image
download rate:
upload rate:
share rating:
seed status:
peer status:
I have no problem starting the process and piping its output to a log file to read it (currently what I do). However the file is getting very big to loop around it. I do have to say I have idea how to read just the last part of the file and since I cant kill the torrent.exe the output just gets appended to the bottom of the log file and can not modify the log file since it is still open by the exe.

I want to create a perl (or maybe use something else) to pipe the output of the exe so that I can query the last values. Say for example my file is call run_torrent.pl, I want to send a command to this file like "run_torrent.pl --percent" and get back the value that was last printed by torrent.exe (the exe does not have these option)

My current limitation is that Im running this from Windows and I can not execute the torrent.exe program again, because it will kill the last download I started.

I am not sure what I am looking for, or how to make my query of the process simpler. I know its a bit confusing but I could really use some help. Some one suggested using StreamReader, but I dont get how I would start the program from the streamreader and how to query it. Running Active perl 5

Thanks for any suggestion,
Sep 16 '08 #1
  • viewed: 2726
1 Reply
Expert 2GB
Look into IPC::Open2 or IPC::Open3 both come with perl
Sep 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Mark Wilson CPU | last post: by
1 post views Thread by Ruben | last post: by
1 post views Thread by funtoosh | last post: by
3 posts views Thread by funtoosh | last post: by
1 post views Thread by momena | last post: by
4 posts views Thread by Pascal Ehlert | last post: by
2 posts views Thread by David | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.