Softpanorama
(slightly skeptical) Open Source Software Educational Society

May the source be with you, but remember the KISS principle ;-)

Softpanorama Search

Commands for translating files from DOS to Unix

These aren't rogue characters but the effect in sharing files between completely unrelated operating systems. ^M is a carriage return and in Windows, all plain ASCII files have each line terminated with CR *and* LF, but in Unix, the lines are terminated with just LF. That's why vi shows ^M at the end of the lines...it's a valid character, just unexpected. Most of the time, these problems come up when sharing filesystems. The assumption is that the data will look the same but since neither Windows no Unix implement filesystembased filetypes, there is no special processing that can go on in the background. (Windows does have a type extension which is just a convenience to launch a specific program to read/write that file but the filesystem code does nothing with the data format).

ftp recognized this issue a *LONG* time ago and implemented an ASCII filter. If you use BINARY to transfer in ftp, you'll get the special codes from Windows. But if you transfer in ASCII, ftp converts the data to target format



Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Disclaimer:

Last modified: July 23, 2009