Regarding the carriage return under different platforms (from bbs.chinaunix.net)

xiaoxiao2021-04-02  269

The '/ r / n' is the end of the text file in Win. The '/ n' is ended as a line of text files in UNIX. In the Mac, the '/ R' is the end of the text file. If the FTP file is used in different platforms, if you use the ASCII mode, you will automatically modify the form suitable for your file system. When operating a function with C's F Series file, if you do not add 'b' parameters, it will be processed. There is no '/ r / n' symbol after the VMS (VAX and DEC machine) ASCII file, but the length is added in front. There is no difference in binary ('b') and ASCII 'A' in UNIX and its C file operation. Under the Linux platform, the 'n' is just a simple interpretation of 0x0D, while writing files under Windows, the 'n' will be replaced with the 0x0D0A write. When reading the file In contrast, when you encounter 0x0D0A, Windows will return to 0x0D, you can use a binary read tool such as HEXWORKSHOP, directly view the files generated under Linux and the files that generated under Windows, you can see this Difference.

转载请注明原文地址:https://www.9cbs.com/read-131351.html

New Post(0)