Solved

Carriage return characters from pc to unix

Posted on 1997-11-17
1
202 Views
Last Modified: 2010-04-15
I cannot get rid of the ^M characters at the end of each line when I write a file from my C code.  I am writing the application on a PC using Visual 5.0 and viewing the output files on Unix.  I have tried the binary call "fwrite" but
the characters end up there anyway.  How do I stop this?!
If I write the entire file in binary will that make any difference?
0
Comment
Question by:ees
1 Comment
 
LVL 1

Accepted Solution

by:
yl earned 50 total points
ID: 1256357
ees,

If you open the file in binary mode and append the '\n' character to each line, the the file will be in Unix format.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now