Hmm to RobertM. Okay, just WHERE did you find the "-Z -R -G" switches? Went
back and read the very short doc that's included, then went looking on the
referenced ctorrent site, on to the enhanced, and I seem to have missed it.
Haven't tried in the source code, as the run-time key commands listed online
don't seem to work, for a start. Those switches aren't even listed in the
Enhanced User's Guide at:
http://www.rahul.net/dholmes/ctorrent/userguide.html#-z
I kinda have a feeling they are OS/2 specific (as the method to populate/change the Window List data would need to be).
Open a command window, do a "MODE 120,60" (that way the output doesnt scroll off the screen), and run cTorrent9.exe...
It will list all it's commandline options, with those added in a section at the bottom (their placement is also another reason I suspect they are OS/2 specific).
Don't know that I actually need to know any more, but I'm curious where you
got them.
Anyhoo, think reading the Window List is the only practical interface, unless
there's some way to find out which strings of colored numbers that go to a
central REXX control program's standard input belongs to which torrent. Right
now I don't see how that'd work, besides that ANSI codes (that garbage up at
least copy and paste) have to be stripped out.
Well, that's where RxQueue and string parsing comes in handy... you could just pipe it there. Now... as for stripping out the ANSI code... well, that is a little more difficult, but could be done, simply by having a list of what the code looks like, or analyzing the output and figuring which sections to grab...
The Escape Sequences are all pretty much the same. The format is the same as well. There is documentation on it all someplace on Hobbes (and maybe in OS/2), and I have something someplace that documents it as well.
In this particular case, you would just need to look for the Escape char, then proceed to the first "m" and get rid of that data - repeat till end of string (or even easier, grab that section of data to a stem variable (ie: MyTorrent.downloadrate.#="Whatever") look for the next ESC sequence, find the data between it and the next ESC char and place in MyTorrent.UploadRate.#, and continue...
The beauty of the output (in terms of ease of parsing) is that it only seems to use color codes... the sequences are thus pretty easy to find. They are all (if memory serves):
ESC[(MODE);(COLOR);(COLOR)m
[ being the VIO color sequence byte (ie: ESC[ indicates color/attribute change to follow)
MODE being blink, bold, etc (some dont apply in certain video modes)
COLOR being either foreground or background colors or both...
m being the end character
On the screen, that looks like:
<[1;35;40m(the < is supposed to be an arrow pointing left - but that doesnt display)
Everything after the "m" (to the next ESC char/arrow) is actual output/displayed on the screen.
Here's my program outline:
At start-up:
Look in a special directory for .torrent files.
Start a VIO for each (via properly modified ctorrent.cmd).
Main loop:
Every 5 seconds: Read the Window List; massage, display. (25 lines, tops.)
Every minute: read my download directory to check for new .torrents; if
found, move to the special directory, then start a VIO. (Firefox would be
set to just download the .torrent.)
Keep in mind one problem... cTorrent only displays part of the info. The title gets cut at a certain character count (havent counted, so dont know what it is - try d/l'ing a torrent with a long name and you will see what I mean).
Thus the only problem with using the Window List data as a method unless you are very careful not to mix up torrents. For instance:
My Big Torrent Name of Some Movie I am Sharing with the World for Everyone To Enjoy - Part 1
My Big Torrent Name of Some Movie I am Sharing with the World for Everyone To Enjoy - Part 2Will all show up on the Window List as:
My Big Torrent Name of Some Movie I am Sharing with the Wor(or something similarly truncated - you get the point)
Now, it is possible that the data stored is larger than that, and reading it from REXX will get a longer string (ie: the limitation is in the Window List - and xWP), but I think it unlikely.
Believe that'd be relatively easy, and fortunately, I'm not the type who even
thinks of bells and whistles. Start-up is the most important part for me, as
I'm near certain to turn the computer off. ── Hmm. Doing proper shutdown of
several torrents would be annoying in itself. I'd just crash 'em.
I have shut down cTorrent while it is running. It seems to exit cleanly. I think sending it a close command whould properly shut it down. On restart, it checks what's there, then continues the download.
So... either it properly shuts down, or verifies the chunks written, and discards bad or incompleted ones from killing it - either way, considering the size of BitTorrent chunks, no big deal.
But now that I've completed all of four torrents for testing and haven't found
any that are of more use than to put some magnetic domains into a certain
pattern, feel free to expand my outline into working code. I'm sure you're
busy, but it's of only passing interest to me, and decreasing.
Well, I have a bunch of projects I really wanna do... use the pipe control in mPlayer for one (to create a GUI controller/playlist)... this as another. So, I'll see what I can do. Wanted to leave it to someone else because I am going away for another Star Trek New Voyages episode shoot in a few days and wont get to it (or mPlayer) till July.
Have an interim solution that at least avoids typing in file names to start or
re-start (the likely use since you've got the MIME type in Firefox) a torrent.
Get my KMPFS10.ZIP from Hobbes. Modify the line for the file types to just
"*.torrent", and the two lines for the executable to:
start /win c:\temp2\ctorrent9.exe
Slight modification could automatically start all torrents with one <enter>.
Neat... will check it out in a bit...
Sorry, nothing at all on your side notes.
S'ok... I need to post it in the proper thread anyway... which I should know (being a moderator and all).

Rob