Re: Can Visual Studio handle Unix-style line-ends?



"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.


.



Relevant Pages

  • Re: Can Visual Studio handle Unix-style line-ends?
    ... their "smart" ftp program was stripping out one of the line feeds. ... Just hope you never have to write software that interacts with a Windows ... > feed) seems incorrect to me; I think that the CrLF that DOS and Windows ... It is not Windows that would do the conversion. ...
    (microsoft.public.vstudio.general)
  • How To Convert Thousands of Works 7.0 Files to Word 2007 Simultaneously
    ... to discuss automatic conversion of *ALL* files of particular types. ... Home Edition of Windows XP on a new Gateway system unit. ... templates directory. ... I've created a macro which automates the use of the Convert command in the ...
    (microsoft.public.word.docmanagement)
  • Re: How To Convert Thousands of Works 7.0 Files to Word 2007 Simultaneously
    ... Dim strFileName As String ... discuss automatic conversion of *ALL* files of particular types. ... "so-called word processor" when I wasn't able to operate Word years ... It was bundled with the Home Edition of Windows XP on ...
    (microsoft.public.word.docmanagement)
  • Re: Backward compatibility with FileMaker 6
    ... I wanted to ask if the latest version of filemaker is ... My best suggestion would be to purchase a copy of MetaData Magic and run a conversion report. ... references to old files that no longer exist, which can create long delays while opening the solution or while some scripts run which require other external FM files to open. ... The result is that you may start getting error messages when you switch windows without first committing the record in the first window. ...
    (comp.databases.filemaker)
  • Re: A 20K Executable with one VB instruction statement...
    ... file is different between different versions of Windows and ... Windows 2K only can handle quad byte conversion ... The above is just the imports. ... I'm thinking that somewhere there's a reference to OLEAUT32.DLL. ...
    (alt.lang.asm)

Loading