public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: cyg Simple <cygsimple@gmail.com>
To: cygwin@cygwin.com
Subject: Re: 2.10.0: Cygwin now can not work well with a file in dos format.
Date: Sun, 17 Jun 2018 01:13:00 -0000	[thread overview]
Message-ID: <1af5d7f7-4b57-0ac7-e9a8-1ccda9e47071@gmail.com> (raw)
In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A17788014D3@IRSMSX102.ger.corp.intel.com>

On 6/16/2018 10:10 AM, Soegtrop, Michael wrote:
> 
> I haven't tried it but according to the release note above this depends on the mount type. It might help to mount your Windows text files in a mount with the text flag set. Binary files should still work on such mounts - as far as I can tell this mount flag has the effect that the binary / text flag to e.g. fopen makes a difference. If you have success with this, I would be interested to learn about it.
> 

This only affects files on disk.  Pipes are still binary mode.  So
depending on how the data is received by awk, sed, etc you may still
receive CRLF instead of the CR removed.  If the application opens the
file directly then it should work to use the text mount option.  I would
caution though that this causes a need-to-know issue and can cause
headaches if the one using the data doesn't know.  I highly suggest not
to use this option and to use the appropriate filters to handle CRLF.
NOTE: This issue exists for all files on Linux as well as you don't know
when you'll have a file with CRLF that needs to be processed.  You're
better off filtering all text files with appropriate tools before
processing them.  Only when ending the file with .txt extension should
the file contain CRLF before sending it back to a user just because of
the brain dead MS Notepad that opens the file in binary mode and expects
the file to contain the control characters to move the cursor left and down.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2018-06-16 20:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 16:19 tuyanyi
2018-06-15 19:46 ` Soegtrop, Michael
2018-06-15 23:50   ` cyg Simple
2018-06-16  0:49   ` Brian Inglis
2018-06-16 14:10   ` Michel LaBarre
2018-06-16 15:21     ` Marco Atzeri
2018-06-16 20:25     ` Soegtrop, Michael
2018-06-16 20:34       ` Michel LaBarre
2018-06-17  1:13       ` cyg Simple [this message]
2018-06-15 22:50 ` cyg Simple

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1af5d7f7-4b57-0ac7-e9a8-1ccda9e47071@gmail.com \
    --to=cygsimple@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).