Monday, October 6, 2014

Re: readfile() and writefile() in practice

On Tuesday, October 7, 2014 9:59:53 AM UTC+13, Benjamin Klein wrote:
> As far as I can tell, readfile() and writefile() have something against new lines...
> Sent from my iPhone

;) I'd guess you're not running Vim on an iPhone (however fun that might be) but on Windows. Looking at the code, I don't think DOS endings are written. There is this comment when writing a file:
/* Always open the file in binary mode, library functions have a mind of
* their own about CR-LF conversion. */

I would expect the written file to be ok when read again by readfile(), or by vim if you have "unix" in your setting of the 'fileformats' option, or even by MS Word, but to hammer away on one line if you use the DOS command "type", and problematic in various Windows utilities, or (I'm guessing here) some Mac software.

Regards, John Little

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: