public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Dave Korn" <dk@artimi.com>
To: <cygwin@cygwin.com>
Subject: RE: com1 access denied - win xp
Date: Thu, 20 May 2004 18:27:00 -0000	[thread overview]
Message-ID: <NUTMEGHmj9n1xxWn9R6000001c5@NUTMEG.CAM.ARTIMI.COM> (raw)
In-Reply-To: <c8im1b$rri$1@sea.gmane.org>

> -----Original Message-----
> From: cygwin-owner On Behalf Of Michael Wood
> Sent: 20 May 2004 17:23

> Hi-ya,
> 
> I get an "Access is denied" error message when attempting to create a 
> serial port connection through Cygwin, running on Win XP.
> 
> In cygwin, when I execute:
> 	ls -l COM1
> 
> I get the following:
> 	-rw-r--r--    1 mwood    mkgroup-        0 Jan  1  1970 COM1
> 
> However, when I execute:
> 	chmod a+rw COM1
> 
> the command exits normally (no error message), but the permissions on 
> COM1 stay the same. Furthermore, I do not particularly 
> understand why if 
> I am the owner of COM1 (as illustrated by the 'ls -l'), why I 
> would get 
> a permission error.
> 
> I have successfully created and used a connection on the 
> serial port on 
> the same machine through a VMWare session running a Linux Red 
> Hat image. 
> I used a very similar procedure above, in that I simply changed the 
> permissions on "/dev/ttyS0" to grant all users read and write 
> permissions to the serial port.
> 
> Help would be greatly appreciated.
> 
> - Mike


#1.  Why not use /dev/ttyS0 again?  Cygwin is a posix compatible layer and
/dev/ttyS0 should work pretty much the same.  BTW, which directory are you
in when you do those commands on COM1?  Did you "cd /dev" or do you expect
it to just work anywhere, and if so, why?

#2.  'doze has some pretty funny ideas about files having the same name as
dos-devices (COMx:, PRN:, LPTx: etc).  It doesn't like it at all.
Presumably somewhere between cygwin and 'doze a bit of confusion is creeping
in.

#3.  I notice that if you're in /dev and you do "ls -la com1", you get the
right answer.  But remember, under Posix, capitalisation matters, so "com1"
and "COM1" are two different files.  Under 'doze, unfortunately, it doesn't.
So probably Cygwin knows that /dev/com1 is the serial port, thinks that
/dev/COM1 is something different because the case doesn't match, assumes
it's an ordinary file and passes the name through to the underlying 'doze
file-handling calls, which disagree with cygwin and think that it IS a
serial port, and then everybody gets confused.

#4.  When I do "ls -la COM1", I just get:

dk@mace /> ls -la COM1
----------    0 ???????? ????????        0 Jan  1  1970 COM1

no matter what directory I'm in.  Bizarre.  When I'm do "ls -la /dev/com1",
I get the proper answer:

dk@mace /> ls -la /dev/com1
crw-rw-rw-    1 dk       Domain U 117,   1 May 20 19:05 /dev/com1

but capitalizing it never works, not even in the /dev directory.

dk@mace /> ls -la /dev/COM1
----------    0 ???????? ????????        0 Jan  1  1970 /dev/COM1

#5.  Anyway, the answer to your problem is that you were using the wrong
filename.  The solution is to use the correct filename; either /dev/com1 or
/dev/ttyS0.  And as to why there's a messed up COM1 in there, that's a
little bugette you've stumbled across.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....

  parent reply	other threads:[~2004-05-20 18:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20 16:49 Michael Wood
2004-05-20 17:45 ` Igor Pechtchanski
2004-05-21  0:10   ` Igor Pechtchanski
2004-05-20 18:27 ` Dave Korn [this message]
2004-05-24 20:30   ` Michael Wood
2004-05-20 20:44 ` Brian Ford
2004-05-21  1:30   ` Brian Ford

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=NUTMEGHmj9n1xxWn9R6000001c5@NUTMEG.CAM.ARTIMI.COM \
    --to=dk@artimi.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).