delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/20/20:02:39

X-Spam-Check-By: sourceware.org
Date: Mon, 20 Mar 2006 20:02:26 -0500 (EST)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: "D.Pageau" <dpageau AT infodev DOT ca>
cc: cygwin AT cygwin DOT com
Subject: Re: Redirect stdin & stdout to serial port
In-Reply-To: <441F2482.2040502@infodev.ca>
Message-ID: <Pine.GSO.4.63.0603201943520.12896@access1.cims.nyu.edu>
References: <441F2482 DOT 2040502 AT infodev DOT ca>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mon, 20 Mar 2006, D.Pageau wrote:

> I have to redirect both stdin & stdout to com1
>
> lrz -X -vv foo.bin > /dev/ttyS0 < /dev/ttyS0
> bash: /dev/ttyS0: Permission denied
>
> This is working on *nix but not with Cygwin.  Why ?

According to the strace, bash opens the port twice, using O_CREAT|O_TRUNC
when redirecting output, and Windows apparently doesn't allow opening a
serial port for writing in that mode after opening it for reading (and
vice versa).

> any work around ?

Well, bash does offer an input/output redirection with the '<>'
operator...  Did you try that?

Also, duplicating the file descriptor might work (e.g., </dev/ttyS0 >&0).

> CYGWIN_NT-5.0 foo 1.5.20(0.155/4/2) 2006-03-19 16:11 i686 Cygwin

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019