delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/01/02/20:51:37

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Sun, 2 Jan 2005 20:51:36 -0500
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: "od" wrong line endings and byte count
Message-ID: <20050103015136.GA9682@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
References: <41D897B8 DOT E802CA0B AT dessent DOT net> <20050103012057 DOT GB444 AT efn DOT org> <41D89FC3 DOT C4EEF420 AT dessent DOT net> <20050103012920 DOT GA1844 AT efn DOT org> <41D8A465 DOT 9B66ECC AT dessent DOT net>
Mime-Version: 1.0
In-Reply-To: <41D8A465.9B66ECC@dessent.net>
User-Agent: Mutt/1.4.1i

On Sun, Jan 02, 2005 at 05:48:21PM -0800, Brian Dessent wrote:
>Yitzchak Scott-Thoennes wrote:
>>>I thought we were talking about 'od' here where presumably you always
>>>want to open files for reading in binary mode?  (And as far as I know
>>>od doesn't write anything, redirection aside...)
>>
>>'twas redirection I was thinking of:
>>
>>$ od /dev/null>od.out
>>$ od /dev/null>textmount/od.out
>>$ ls -l od.out textmount/od.out
>>-rw-r--r--  1 sthoenna None 8 Jan  2 17:28 od.out
>>-rw-r--r--  1 sthoenna None 9 Jan  2 17:28 textmount/od.out
>
>Redirection is setup by the shell, so the program whose output is
>redirected has no say on how the file is opened.

In general, you're right, but the program can use setmode() to control
the behavior of open fd's, like standard output.  Then it can choose
whatever behavior it likes.

cgf

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