🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7914

Re: open vs fopen?

#7914
From: Kazimir Kylheku
Date: Sat, 10 Feb 1996 05:26
24 lines
1594 bytes
In article <4f8bev$6tr@hermes.louisville.edu>,
George C. Lindauer <gclind01@starbase.spd.louisville.edu> wrote:
 >natewild@mbnet.mb.ca (Nathan T. Wild) writes:
 >
 >>In C, why would one use open and DOS int handles rather than fopen and
 >>stdio file handles?
 >
 >The only reason I know of is UNIX portability.  Whenever I run across a
 >unix program that uses the old-style open instead of fopen I usually

There is nothing "old-style" about open(). It is a system call whereas fopen is
a standard C library function. The open() function is typically a  stub which
calls the operating system's open function directly. The fopen() library
routine uses open(), and stores the returned file descriptor inside the FILE
structure.

 >end up rewriting it anyway though; I've had so many problems with
 >the unix-style stuff I just rather would deal with the ANSI style.

The "ANSI style" still calls the "unix-style" stuff, except everything is
bounced through extra buffers. The standard library functions are for
programmer convenience; that's why UNIX evolved them. But it's not a case of
one replacing the other.
-- 
Technical Details
Message-ID: <4fha9lINN7mi@keats.ugrad.cs.ubc.ca>
Path: arc1-ca.pugleaf.net!keats.ugrad.cs.ubc.ca!not-for-mail
References: <uEYFxc9nX8WX083yn@mbnet.mb.ca> <4f8bev$6tr@hermes.louisville.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!keats.ugrad.cs.ubc.ca!not-for-mail
From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
Newsgroups: comp.os.msdos.programmer,comp.lang.c
Subject: Re: open vs fopen?
Date: 9 Feb 1996 21:26:13 -0800
Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
Message-ID: <4fha9lINN7mi@keats.ugrad.cs.ubc.ca>
References: <uEYFxc9nX8WX083yn@mbnet.mb.ca> <4f8bev$6tr@hermes.louisville.edu>
NNTP-Posting-Host: keats.ugrad.cs.ubc.ca