delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/03/10:11:31

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <011701c07598$ddd97a30$0200a8c0@lifelesswks>
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: <cygwin AT cygwin DOT com>
Subject: new function suggestion fsetmode
Date: Thu, 4 Jan 2001 02:21:36 +1100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

Hi,
    I'd like to suggest a function for working on FILE* handles

int fsetmode(FILE* fhandle, int mode)
{
    if (fhandle)
        return setmode(fhandle->_file, mode);
    else
        return EOF;
}

I wasn't sure where in cygwin to place it... so I'll leave that up to the core group. I ran across a whole bunch of fopen calls
recently that needed to be forced into text mode.. this is how I've done it.

Maybe bad things happen doing this? I assume not. But as the function needs to look into the FILE * struct's privates, I figure it
should be part of cygwin itself.

Rob


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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