X-Spam-Check-By: sourceware.org Date: Mon, 20 Mar 2006 20:02:26 -0500 (EST) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: "D.Pageau" cc: cygwin AT cygwin DOT com Subject: Re: Redirect stdin & stdout to serial port In-Reply-To: <441F2482.2040502@infodev.ca> Message-ID: References: <441F2482 DOT 2040502 AT infodev DOT ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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., &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/