Solved

Visual C++ Ver 5 Editor

Posted on 1998-02-06
6
192 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

760 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

20 Experts available now in Live!

Get 1:1 Help Now