天天看点

Transferring Files With FTP

    It is a shame that I don't know how to transfer a file from Windows to Solaris, because of which my colleagues made a laugh at me. Today my senior, by the way he is the one who leads me into BI, asked me in which mode I use FTP to transfer all the rules files from NT to Solaris. I said to him it was not binary mode. Why I know this? Actually it wasn't me who transferred all the files onto Solaris, and we used the software FlashFTP to do the job.I rarely used it before. So I don't know when using the software, you can still set the transferring mode. Tonight I downloaded one. Yes, I found the modes we can set when transferring a file.

    There are two modes, one is called binary mode and the other is ASCII mode. What's the differences between the two of them? I searched from the Internet just now. If the file contains some simple ASCII characters(text editing files and HTML files), you will use ASCII mode to transfer your file. But if you want to transfer files like executable files, winrar/zip files, image files, you have to use binary mode or your files would be damaged.

The important point is that if the file in Solaris is a text editing file, you have to use ASCII mode to transfer your file.

(ascii模式下会转换文件不能说是不同系统对回车换行解释不同而是不同的系统有不同的行结束符unix系统下行结束符是一个字节,即十六进制的0A而ms的系统是两个字节,即十六进制的0D0A所以当你用ascii方式从unix的ftp  server下载文件时(不管是二进制或者文本文件),每检测到一个字节是0A,就会自动插入一个0D,所以如果你的文件是二进制文件比如可执行文件、压缩包什么的,就肯定不能用了。如果你的文件就是unix下的文本文件,你用ascii模式是正确的,要是误用了binary模式,你在windows上看这个文件是没有换行的,里面是一个个的黑方块。一般来说,我们最好都用binary方式,这样可以保证不出错。如果有文本格式转换的问题,即unix格式的文本和dos格式的文本之间的转换,有很多工具可以做的,不要在ftp传输的时候冒险,尤其是你如果对这些东西不是非常清楚的话。)