In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the difference between binary mode and ascii mode in the ftp command, the content is very detailed, interested friends can refer to, hope to be helpful to you.
FTP can transfer files in a variety of formats, usually determined by the system, and most systems (including UNIX systems) have only two modes: text mode and binary mode. The text transmitter uses ASCII characters and is separated by enter and newline characters, while binary can pass characters without conversion or formatting, binary mode is faster than text mode, and can transfer all ASCII values, so system administrators generally set FTP to binary mode.
Generally speaking: if you transmit your picture in the wrong mode, you will not be able to see the picture and will see garbled code. If you upload a CGI script in error mode, you will not be able to run your script and you will see an error message similar to Server 500 Error.
So you must use the correct mode, pictures and execution files must be in BINARY mode, CGI scripts and ordinary HTML files must be uploaded in ASCII mode.
Differences between ASCII and BINARY modes:
Files written in HTML and text must be uploaded in ASCII mode. Uploading in BINARY mode will destroy the file and cause file execution errors.
BINARY mode is used to transfer executable files, compressed files, and picture files.
If you send it in ASCII mode, it will show a lot of garbled code, and you must send it in BINARY mode again.
For the second case, it is because there are many ftp servers and client software that can automatically identify the file type and transfer it accordingly.
Ftp is an application layer protocol and has nothing to do with the specific operating system.
The difference between ASCII mode and BINARY mode is the processing of carriage return line feeds. Binary mode does not do any data processing. Asci mode converts carriage return line feeds into native carriage return characters. For example, it is\ r\ nline feeds in Unix and\ r in windows.
Files are converted in ascii mode
It can't be said that different systems have different interpretations of carriage return and line wrapping.
It's that different systems have different line Terminators.
The downlink Terminator of the unix system is one byte, that is, hexadecimal 0A
Ms's system is two bytes, the hexadecimal 0D0A.
So when you download a file from unix's ftp server in ascii (whether binary or text file), every byte detected is 0A, an 0D is automatically inserted, so if your file is a binary file such as an executable file, a zip file, etc., it certainly can't be used. If your file is a text file under unix, you are correct to use ascii mode. If you misuse binary mode, you will not wrap the file on windows. There are black squares in it.
Generally speaking, we'd better use the binary method to ensure that there are no mistakes. If there is a problem with text format conversion, that is, unix format
There are many tools to convert between text in dos format and text in ftp format. Don't take risks during ftp transfer, especially if you are not very clear about these things.
You can use MIME to convert all characters into characters between 0x128, and then transmit them, and then reverse convert the received characters MIME at the receiver. Usually when we send an email, we use this way of character conversion.
Add: the specific difference between text mode and binary mode text files can be seen by using the "cat-A file name" under linux, of course, the premise is that the text uploaded under windows is in dos format, which can be viewed with an advanced text editor such as UltraEdit. The difference between the two is that the text uploaded in binary mode has one more ^ M symbol than the text mode. This is the / r carriage return symbol in dos format under windows, that is, the hexadecimal 0D mentioned above, using global substitution under vi:% s / ^ M / g [^ M uses Ctrl+V+M instead of entering ^ M directly] to remove all carriage returns or use dos2unix file for conversion. In this way, the saved or generated file is the same as the file uploaded in text mode.
So much for sharing the difference between binary mode and ascii mode in the ftp command. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.