Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ftp in ascii mode change file size?

0 views
Skip to first unread message

Dan Lam

unread,
Mar 3, 1993, 1:19:21 PM3/3/93
to
I tried to ftp an ascii file from a hp unix machine to my pc. In ascii mode,
the file size comes out sometime different. When I tried in binary mode I
get exactly same size everytime. However, when I do a 'type filename' on my
pc, the file looks odd (and I could not load to another tool).

My guess is that when I transfer the file in ascii mode, pc format may fill
the blocks with null characters, this effects file size. On the other hand,
in binary mode, pc format translates a new line to a carriage return and a
new line (or vice versa).

Any comments? Thanks in advance.


Dan Lam

Bob Fisher

unread,
Mar 4, 1993, 7:41:12 AM3/4/93
to
From article <C3Bs8...@The-Star.honeywell.com>, by da...@cfsmo.honeywell.com (Dan Lam):

What is a newline in UNIX is a combination of a linefeed and a carriage
return in DOS. This gets transformed in ftp with an ascii transfer.
The binary transfer does not make this translation. When you "type" the
file, what is normally a new line begins directly below the end of the
preceeding line. The UNIX newline becomes a DOS linefeed without the
carriage return. The file size is the same, but it looks funny.

If you do a "wc -l" on the UNIX file. The number of lines that it shows
should be the same as the difference in the file sizes.

Bob

0 new messages