Re: Can Visual Studio handle Unix-style line-ends?
- From: "Sam Hobbs" <samuel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Apr 2005 12:38:13 -0700
"Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uC1kGEaSFHA.1476@xxxxxxxxxxxxxxxxxxxxxxx
> He's referring to line feeds, if that makes more sense to you. In Windows,
> lines are delimited by CR(13) + LF(10). In Unix, Line Feeds are simply LF
> (no CR).
Yes, I am familiar with all that. Often it is easy to be unsure of which of
the two is first. For C/C++ programmers, "\r\n" is correct and "\n\r" is
incorrect. So I tell C/C++ programmers to remember "Registered Nurse" to
remember that "\r\n" is the correct sequence.
A carriage return just moves a cursor or print head horizontally and a line
feed just moves vertically. So Unix-style end-of-line (just a line feed)
seems incorrect to me; I think that the CrLF that DOS and Windows uses is
more consistent with the purpose of the characters.
I don't know how relevant all that is; I hope it helps somewhat.
I might be a bit too picky about terminology. Peter said "a way to tell
Windows" which, if a person thinks about it, is not likely to be something
that exists. It is not Windows that would do the conversion. So then I did
think about it, and I realized that I am not familiar with any Windows SDK
function that recognizes the CrLf in files. It is Windows applications that
recognize end-of-line and such in files. The C and C++ languages have
exteensive support for conversion of CrLf to/from a Lf.
I think it would help Peter a lot to understand that technically speaking
Windows does not recognize the CrLf or Lf in files.
> I haven't answered his question because I've faced the same issue (the
> other way around - I had to create Unix-style files and FTP them to a Unix
> server), which I haven't found an easy solution for. My problem was
> complicated by the fact that the particular server I was sending the files
> to required ASCII instead of UniCode. But I did solve it for my own
> purpose.
I am sure you are very capable of solving the problem. However I assume
there are relatively simple and productive solutions, but if you have not
found an easy solution then perhaps it is not so easy.
It is definitely true that Windows applications seem to have a lot less
support of Unix-style end-of-line than Unix does of Windows-style
end-of-line. Therefore it is often easier to do the conversion in the Unix
end.
For you, one possiblity is to use a FTP program that does the comversion. In
fact, your FTP program might have the capability.
For Peter, I would check to see if SCM has such a capability. I don't know
what is meant by SCM so I can't help much. If however the SCM does not have
direct support of the conversion (my guess is that it does) then the next
thing I would check for is if there is a macro capability that can process
the input and output to do the conversion.
.
- Follow-Ups:
- Re: Can Visual Studio handle Unix-style line-ends?
- From: Jim Rand
- Re: Can Visual Studio handle Unix-style line-ends?
- From: Kevin Spencer
- Re: Can Visual Studio handle Unix-style line-ends?
- References:
- Can Visual Studio handle Unix-style line-ends?
- From: Peter Steele
- Re: Can Visual Studio handle Unix-style line-ends?
- From: Sam Hobbs
- Re: Can Visual Studio handle Unix-style line-ends?
- From: Kevin Spencer
- Can Visual Studio handle Unix-style line-ends?
- Prev by Date: Re: Non-programmers are getting Visual Studio 2005 Beta 2
- Next by Date: Re: Can Visual Studio handle Unix-style line-ends?
- Previous by thread: Re: Can Visual Studio handle Unix-style line-ends?
- Next by thread: Re: Can Visual Studio handle Unix-style line-ends?
- Index(es):
Relevant Pages
|
Loading