Solved

Visual C++ Ver 5 Editor

Posted on 1998-02-06
6
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

695 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