1 byte more?

Xu Qiang Qiang.Xu at fujixerox.com
Wed Jul 20 04:44:26 GMT 2005


Hi, all: 

I just met a strange problem. 

In FreeBSD 5.3, I want to create a new txt file with vi, and type a single digit into it, and save it for future use.

My steps are: 
1 vi count.txt
2 type i (for insert mode)
3 type 0
4 Esc
5 :wq

Then by "ls -l", I found the file's size is 2 bytes, intead of 1 byte as I expected. 

Then I did a similar thing in MS Windows, to create a txt file with only 1 digit in it. The behavior is expected, the file is 1 byte long. And when I ftp'ed that file to FreeBSD, the size is still correct. 

Why does vi in FreeBSD add 1 invisible character to the txt file? 

Looking forward to any possible help, 

Regards,
Xu Qiang




More information about the freebsd-questions mailing list