ftp return format

rzantow at my-deja.com rzantow at my-deja.com
Fri May 5 13:07:41 EDT 2000


In article <zFyQ4.7608$E44.186312 at news6-win.server.ntlworld.com>,
  "Richard Chamberlain" <richard_chamberlain at ntlworld.com> wrote:
> We use a thing called Rumba FileTransfer which is obviously
translating
> somehow, anyone know how I can do the same?
>
> e.g.
>
> from python:
>
> 0183
> 0000100000000000000000000000000000000000K0000000000000K
> 0184
> 0000300000013200000000000000000000000000000000013200000
> 0185
> 0000300001185200000000000000006M0000000000000118520006M
>
> from Rumba:
>
> 0183                               1            0         0
> 0        -2         0    -2
> 0184                               3        132         0
0        0
> 132     0
> 0185                               3    11852         0    -64
0
> 11852   -64
>
> I realise that it's fix delimited, but then I get stuck on the K and
M which
> crop up with negative numbers.
>

Richard,

These appear to be overpunched characters (a remnant of cardpunch
entry) and the characters directly translate into digits, with the
implication that the entire numeric field carries a negative sign.

If you isolate the field, Translate '}' to '0', J-R to 1-9
respectively, and multiply its numeric value by -1, you'll get the
correct effect. It's likely that someone has already had to do this,
but I haven't (in Python, anyway). Pretty trivial, though.

--
Pythons, unlike some other snakes, do have hindlimbs, but they never
develop beyond vestigial stumps. The arrest of limb development is
due to a failure of the sonic hedgehog signalling system ...


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list