Re: telnet read_sb_data



Thank you for your reply.

Yes I have read the documentation. But I am not sure what is the SB/SE
suboption. Is this a suboption on the remote machine or for Python.
Maybe you could be so kind and explain it to me with a little code example.

Thany you very much!
Arne

"Dennis Lee Bieber" <wlfraed@xxxxxxxxxxxxx> schrieb im Newsbeitrag
news:2khu32leqvokk8jnt67nsf4e1f4bnr5deq@xxxxxxxxxx
On Thu, 13 Apr 2006 23:45:06 +0200, "Arne" <arne.meissner@xxxxxx>
declaimed the following in comp.lang.python:

1. What I look for is the option to get only certain parts of the output.
It
seems to me that the command "read_sb_data" can do this. The
documentation
says, that I will get the data between the SB/SE pair. But I don't know
how
to invoke the SE command in Unix. Even I don't know the SE command.

Did you read the full documentation? "SB/SE" are "suboption
begin/end", and there is also mention of a "callback". The ONLY other
entry in telnetlib that mentions callbacks is the one for negotiating
telnet options.

read_sb_data( )
Return the data collected between a SB/SE pair (suboption begin/end).
The callback should access these data when it was invoked with a SE
command. This method never blocks.

set_option_negotiation_callback( callback)
Each time a telnet option is read on the input flow, this callback (if
set) is called with the following parameters : callback(telnet socket,
command (DO/DONT/WILL/WONT), option). No other action is done afterwards
by telnetlib.


Using os.stat(path) doesen't work on XP, I am always getting a 0 return

No surprise -- os.stat can only access files mounted on the local
machine. Telnet is remote /terminal/ connection. You'll have to behave
like a terminal... How would you, as a user at a terminal, know when any
command had finished? Probably by seeing a console prompt...

Try

read_until( expected[, timeout])
Read until a given string, expected, is encountered or until timeout
seconds have passed.
When no match is found, return whatever is available instead, possibly
the empty string. Raise EOFError if the connection is closed and no
cooked data is available.

You'll have to know what the prompt string will be...
--
============================================================== <
wlfraed@xxxxxxxxxxxxx | Wulfraed Dennis Lee Bieber KD6MOG <
wulfraed@xxxxxx | Bestiaria Support Staff <
============================================================== <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <


.



Relevant Pages

  • Re: Networks,,,,,,,,,,,,,,,,,,,,
    ... > service portmap restart ... > Once you have the exports file set up, you can run the command: ... > Note that these lines need to be there on both bill's and ted's hosts ... Well, to do that, you need to make sure that the telnet, ftp and ...
    (Fedora)
  • Re: Networks,,,,,,,,,,,,,,,,,,,,
    ... service portmap restart ... Once you have the exports file set up, you can run the command: ... Note that these lines need to be there on both bill's and ted's hosts ... You said you wanted to "make telnet, ftp and ssh work between the ...
    (Fedora)
  • Re: How to remote control the device using command line input from PC?
    ... It somewhat different, use telnet instead. ... Just open command prompt window on your development machine ... ActiveSync can't work over RNIDS connection ... You can use USB serial function instead ...
    (microsoft.public.windowsce.embedded)
  • Re: Emails stuck in queue error 451 4.4.0 Primary target IP addres
    ... If you had just said "Siv you forgot to include the port number in the ... Telnet command" in your first response after asking me to carry out the ... I said earlier I am not familiar with telnet, I have probably used it twice ... Connecting To smtp.surfdsl.net...Could not open connection to the host, ...
    (microsoft.public.exchange.misc)
  • Re: Reset a Cisco 1711 VPN
    ... VPN tunnel through a Cisco 1711 router. ... The network people here have given me the command to issue if I ... were to telnet the router. ... Winsock control that Lance Wynn suggested. ...
    (microsoft.public.vb.general.discussion)