[comp.sys.3b1] XMODEM file padding

gandrews@netcom.COM (Greg Andrews) (04/13/91)

In article <1991Apr9.161637.12059@oswego.oswego.edu> ostroff@oswego.Oswego.EDU (Boyd Ostroff) writes:
>
>The only problem I've noticed is that there are often a bunch of NULLs 
>appended to the end of the file, as though the two programs couldn't agree 
>on where the file ends...
>

XMODEM doesn't send any file name or file length information to the
receiver, and the data packets are 128 bytes in size, period.

If the file size doesn't match up to an exact multiple of 128 bytes, the
last packet will be only partly full of file data.  The protocol has to
put SOMEthing into the packet to fill it out, and nulls are often used.

-- 
.------------------------------------------------------------------------.
|  Greg Andrews   |       UUCP: {apple,amdahl,claris}!netcom!gandrews    |
|                 |   Internet: gandrews@netcom.COM                      |
`------------------------------------------------------------------------'

dnichols@ceilidh.beartrack.com (DoN Nichols) (04/14/91)

In article <1991Apr13.014747.7144@netcom.COM> gandrews@netcom.COM (Greg Andrews) writes:
>In article <1991Apr9.161637.12059@oswego.oswego.edu> ostroff@oswego.Oswego.EDU (Boyd Ostroff) writes:
>>
>>The only problem I've noticed is that there are often a bunch of NULLs 

	[ ... ]

>If the file size doesn't match up to an exact multiple of 128 bytes, the
>last packet will be only partly full of file data.  The protocol has to
>put SOMEthing into the packet to fill it out, and nulls are often used.

	Also VERY frequently used is the '^Z' character, since it is
interpreted as 'EOT' by text-mangling utilities under CP/M (where the xmodem
protocol originated), and, by extension, MS-DOS.  The packet size was chosen
to be a single sector on then-popular implementations of CP/M.  (I don't
know whether CP/M ever had any other size sectors, alghough probably CP/M-86
which ran on IBM-PC hardware probably used larger sectors, at least as an
option.  At least there are never more than 127 of them, so I can get rid of
them using JOVE, and not have to resort to emacs. :-)

	Kermit is a MUCH nicer protocol, it's a pity that it has so much
overhead :-) (Although two of the newer ones talking to each other are not
bad at all.

-- 
Donald Nichols (DoN.)		| Voice (Days):	(703) 664-1585
D&D Data			| Voice (Eves):	(703) 938-4564
Disclaimer: from here - None	| Email:     <dnichols@ceilidh.beartrack.com>
	--- Black Holes are where God is dividing by zero ---