Menu

#1369 MSYS awk treats all input files as binary (should be text)

MSYS
closed
nobody
None
wont-fix
Known_Feature
2013-01-23
2009-11-09
No

MSYS awk treats all input files specified as parameter as binary on default MSYS installation.

Regular gawk compiled on Windows without MSYS wrapper uses MS CRT fopen(...,"r") for all file reads unless BINMODE=r or BINMODE=rw (see awk docs), if BINMORE is set then it calls fopen(...,"rb"). On Windows "r" means default mode (which is TEXT), "rb" means binary.

However MSYS awk uses wrapped fopen where "r" means mount mode which is always BINARY (because all MSYS mounts are binary by default).

So MSYS awk build should used some patched MSYS gawk io.c binmode function (line 239) where "t" is explicitely specified, so "rt" instead of "r", or "wt" instead of "w".

uname -a
--------------
MINGW32_NT-5.1 VMONO 1.0.11(0.46/3/2) 2007-12-04 23:31 i686 Msys

awk --version
-------------------
GNU Awk 3.1.7

Discussion

  • Earnie Boyd

    Earnie Boyd - 2009-11-12

    MSYS itself forces all channels to be opened binary mode and this is by design. MSYS just like UNIX expects line endings to be \n.

     
  • Earnie Boyd

    Earnie Boyd - 2009-11-12
    • status: open --> closed-wont-fix
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-23
    • labels: MSYS -->
    • status: closed-wont-fix --> closed
    • resolution: --> wont-fix
    • category: --> Known_Feature
    • milestone: --> MSYS