X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Wed, 9 Apr 2008 12:36:33 -0700 (PDT)
From: David Dyck <david.dyck@fluke.com>
To: mjumbe@seas.upenn.edu
cc: cygwin@cygwin.com
Subject: Re: Using windows text mode without setup.exe
In-Reply-To: <20080409145136.b3kibhnxhcwscws0@webmail.seas.upenn.edu>
Message-ID: <Pine.LNX.4.62.0804091234470.17660@dd.tc.fluke.com>
References: <20080409145136.b3kibhnxhcwscws0@webmail.seas.upenn.edu>
MIME-Version: 1.0
Content-Type: TEXT/Plain; charset=US-ASCII; format=flowed
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Wed, 9 Apr 2008 at 11:51 -0700, mjumbe@... wrote:

> ....  The application needs read from and write to files in
> text mode (i.e. using CRLF format).  This works fine on my development
> machine, because I can just use the Cygwin setup program to specify
> the Windows text mode as default.  However, when I package up my
> distribution with the Cygwin dll and install it elsewhere, the program
> writes UNIX linefeeds.

http://www.cygwin.com/cygwin-ug-net/using-textbinary.html

     In the open() function call, binary mode can be specified with the flag
     O_BINARY and text mode with O_TEXT. These symbols are defined in fcntl.h.

     In the fopen() function call, binary mode can be specified by adding
     a b to the mode string. Text mode is specified by adding a t to the
     mode string.

     The mode of a file can be changed by the call setmode(fd,mode) where fd
     is a file descriptor (an integer) and mode is O_BINARY or O_TEXT. The
     function returns O_BINARY or O_TEXT depending on the mode before the call,
     and EOF on error.

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

