Article View: alt.msdos.programmer
Article #78Re: file positioning with buffered/unbuffered I/O
From: Alan Bowler
Date: Tue, 11 Aug 1992 02:10
Date: Tue, 11 Aug 1992 02:10
31 lines
2087 bytes
2087 bytes
In article <l85skiINN9vb@levelland.cs.utexas.edu> phil@cs.utexas.edu (Philip Smolen) writes: >In article <1992Aug6.154146.11988@irscscm.UUCP> cwilkins@irscscm.UUCP (Charlie Wilkinson) writes: >[Lots deleted] >>You might want to consider using the low level I/O functions: >>open() >sopen() >creat() >dup() & dup2() >lseek() >>tell() >read() >write() >eof() >close() >> >>My book (The MSC Bible 2nd edition) says >>that although none of these functions are ANSI compliant, almost all of them >>can be used with every compiler. The exception being that some are not >>Unix and/or Xenix compatible. > >I thought these WERE the unix file utilities. (as opposed to the ansi >file utilities) According the Borland C++ 3.1 online help, only eof() >is not ANSI compliant. eof() can be avoided with lseek() and tell(). > >IMHO the Unix file utilities are easier to use than the corresponding >ANSI ones. > For SOME applications, the UNIX I/O calls will be both faster and easier to use than the ANSI calls that are built on top of them. However, a program that uses these calls may not port to a non-Unix system. For operating systems with files systems are not organized like they are in Unix, it it likely that these functions will not be implemented. Instead there will be functions like Q$DIO, _callio() etc which give you the same low level access to the way that file system is organized as creat() and friends give you on Unix. Looking for "creat()" on other systems is about as sensible as looking for Q$DIO on Unix.
Technical Details
Message-ID:
<1992Aug11.021029.10759@thinkage.on.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!thinkage!atbowlerReferences:
<1992Aug02.080128.18475@technix.mn.org> <1992Aug6.154146.11988@irscscm.UUCP> <l85skiINN9vb@levelland.cs.utexas.edu>Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer,comp.lang.c,comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!thinkage!atbowler From: atbowler@thinkage.on.ca (Alan Bowler) Subject: Re: file positioning with buffered/unbuffered I/O Message-ID: <1992Aug11.021029.10759@thinkage.on.ca> Organization: /etc/organization References: <1992Aug02.080128.18475@technix.mn.org> <1992Aug6.154146.11988@irscscm.UUCP> <l85skiINN9vb@levelland.cs.utexas.edu> Date: Tue, 11 Aug 1992 02:10:29 GMT Lines: 31