Google 群组不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

Ftp in ascii mode change file size?

已查看 0 次
跳至第一个未读帖子

Dan Lam

未读,
1993年3月3日 13:19:211993/3/3
收件人
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

未读,
1993年3月4日 07:41:121993/3/4
收件人
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 个新帖子