public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: cygwin@cygwin.com
Subject: Re: Conflict between Cygwin 1.7 and Ubuntu for Windows 14316
Date: Wed, 13 Apr 2016 13:36:00 -0000	[thread overview]
Message-ID: <570E4B45.7000201@cs.umass.edu> (raw)
In-Reply-To: <20160413131128.GA3162@mercury.ccil.org>

On 4/13/2016 9:11 AM, John Cowan wrote:
> LLoyd scripsit:
>
>> John, if you can confirm?
>
> Exactly right.
>
>> Please also provide the "cat /mnt/c/file1" and "cat /mnt/c/file2" from UoW.
>
>From the Cygwin shell (note that my Cygwin and Windows home directories
> are the same: /home/cowan is a Cygwin symlink to /cygdrive/c/Users/cowan):
>
> cowan@large-skunk ~
> $ echo stuff >file1
>
> cowan@large-skunk ~
> $ cat file1
> stuff
>
> cowan@large-skunk ~
> $ ls -l file1
> -rw-r--r--+ 1 cowan cowan 6 Apr 13 08:57 file1
>
>From cmd.exe:
>
> c:\Users\cowan>echo stuff >file2
>
> c:\Users\cowan>type file2
> stuff
>
>From UoW bash prompt:
>
> root@localhost:~# cd /mnt/c/Users/cowan
> root@localhost:/mnt/c/Users/cowan# cat file1
> cat: file1: Permission denied
> root@localhost:/mnt/c/Users/cowan# cat file2
> stuff
> root@localhost:/mnt/c/Users/cowan# ls -l file1 file2
> -rwxrwxrwx 1 root root 6 Apr 13 12:57 file1
> -rwxrwxrwx 1 root root 8 Apr 13 12:57 file2
>
> As you can see, they look exactly the same but are different somehow.
> What is more, if I use cmd.exe echo to append to file1 and Cygwin echo
> to append to file2, it changes nothing.  Likewise, if I overwrite them
> completely, it changes nothing.  Only if I remove them and re-create
> them from the "wrong" side does file1 become readable and file2 become
> unreadable.
>
> This is 64-bit Windows on an NTFS file system, but 32-bit Cygwin.  I'll
> try installing Cygwin64 tonight and seeing if that makes any difference.


You can use the cygwin od (octal dump) command to see the exact byte contents
of the files.  (Use od -c <file>.)  I suspected that one difference was \r\n
line termination from Windows echo and \n termination from cygwin echo.  That
did not explain the two byte difference in length, however.  I tried it myself
and found that cmd's echo adds a space after "stuff".  If I do:
c:\Users\moss> echo stuff> file1
(Note: no space before the > !)
It writes "stuff" without the extra space.  The line termination is still \r\n.
cygwin's echo gets rid of the space (because bash trims it before passing the
"stuff" argument) and uses \n as the line terminator.

As for permissions issues, that would have to do with cygwin's permission
system, a rather different topic.

Perhaps you did not know that the two echo's are different?

Regards -- Eliot MOss

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

  reply	other threads:[~2016-04-13 13:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13  5:23 John Cowan
2016-04-13 10:02 ` Gerrit Haase
2016-04-13 12:29   ` LLoyd
2016-04-13 13:11     ` John Cowan
2016-04-13 13:36       ` Eliot Moss [this message]
2016-04-13 15:44         ` John Cowan
2016-04-13 16:22           ` Gerrit Haase
2016-04-14  9:12             ` Evgeny Grin
2016-04-14  9:35               ` Evgeny Grin
2016-04-15  8:49               ` Gerrit Haase
2016-04-15 11:38                 ` Corinna Vinschen
2016-04-16 18:54                   ` Evgeny Grin
2016-04-18 13:26                   ` Gerrit Haase
2016-04-18 17:14                     ` Gerrit Haase
2016-04-16 18:58                 ` Evgeny Grin
2016-04-15  0:51             ` John Cowan
2016-04-15  8:47               ` Gerrit Haase
2016-04-15 16:23                 ` John Cowan
2016-04-16 12:50                   ` Matt Smith
2016-04-13 22:35           ` Andrey Repin
2016-04-14  8:17         ` Evgeny Grin
2016-04-13 17:32 KARL BOTTS
2016-04-15  0:56 KARL BOTTS
2016-04-15  1:04 ` John Cowan

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=570E4B45.7000201@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --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).