Solved

Visual C++ Ver 5 Editor

Posted on 1998-02-06
6
196 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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 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.

810 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