Solved

Visual C++ Ver 5 Editor

Posted on 1998-02-06
6
195 Views
Last Modified: 2010-04-10
System is WinNT4, and Win95.
I need a macro which saves text files (.cpp, .h, .rc2) in unix format?
or how can this be done?
0
Comment
Question by:twexperts
  • 3
  • 2
6 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1180967
What do you mean by unix format?  
0
 
LVL 1

Author Comment

by:twexperts
ID: 1180968
By unix format, I mean in unix you view a dos file and it has at the end of every line a ^M character.
This is because dos sends a carriage return & line feed at the end of every line. Where as unix only does one of them (Carriage return), anyway the codes are 010 and 013, and VBscript in VC++5 does have the constants vbCr and vbCrLf (also vbLf). Does that make things a bit clearer?
0
 
LVL 22

Expert Comment

by:nietod
ID: 1180969
makes sense.  But I suspect that you can't make vissual C save files in a "unix" format.  Your best bet will probably be to write a c program to convert from one format to the other.  It should be pretty easy.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:twexperts
ID: 1180970
Yes we do have unix and dos scripts that do it, but rather than calling the scripts x thousand times when we do a full recompile, it would be better to solve the problem at the source, i.e. save the files in unix format. :)
0
 
LVL 2

Accepted Solution

by:
shogi earned 100 total points
ID: 1180971
you need to take _read() and _write() fonction this function don't perform the translation 10+13. But because your file already having 10+13 in your Text file you have to translate each  10+13 in 10 (if it's needed) and use _write() to create you new file.  I use that for binary file, but UNIX to WIN.
0
 
LVL 1

Author Comment

by:twexperts
ID: 1180972
Could you give a bit more detail on using these functions, i.e. scanning the file, replacing chars, and then writing the file... And are you sure that the write() call doesn't append the end of line codes to each line?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

863 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

25 Experts available now in Live!

Get 1:1 Help Now