2014/1/9 lh_mouse <lh_mo...@126.com>: > I know that. > But in nano's source code it isn't the case. That should be fixed then. Either you open it in text-mode, or in binary mode. > Nano's author did use "wb" in fdopen() but dropped the O_BINARY flag in > open(). As a result, when you use win mingw nano (you can get it from here > http://code.google.com/p/mingw-and-ndk/downloads/detail?name=win-mingw-nano.7z) > and explicitly assign a DOS format, you get two CRs and 1 LF for each line > break. (That version of nano was compiled with mingw. I just compiled > nano-2.3.2 today and got the same problem, and I have fixed that.) That is a user-bug. I admit that it is a pretty weak thing that MS' fdopen doesn't check for binary by itself, but so report this issue to MS directly. We are here just user of msvcrt (or any different msvcr???.dll), and own its bugs too.
> I didn't find any documentations mentioning that which mode (text or binary) > shall be used if fdopen() mode conficts with open() mode. And that's my > question. Well, on msdn http://msdn.microsoft.com/en-us/library/dye30d82.aspx in the remark-section there might be a hint on that. They write ..."The _fdopen function associates an I/O stream with the file that is identified by fd, and thus allows a file that is opened for low-level I/O to be buffered and formatted.".... So the question is what is meant by "opened for low-level I/O". As text-mode translation isn't low-level anymore. > 2014-01-09 > lh_mouse > Kai ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public