This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Redirect stdin & stdout to serial port

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

      |\      _,,,---,,_ |
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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]