home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!usc!sol.ctr.columbia.edu!destroyer!gumby!wmichgw!754clifton
- From: 754clifton@gw.wmich.edu
- Newsgroups: comp.lang.c
- Subject: Re: Help: read() question.
- Message-ID: <1992Aug22.153239.5054@gw.wmich.edu>
- Date: 22 Aug 92 15:32:39 EST
- References: <1992Aug21.154401.5050@gw.wmich.edu> <25663@dog.ee.lbl.gov>
- Organization: Western Michigan University
- Lines: 33
-
- In article <25663@dog.ee.lbl.gov>, torek@horse.ee.lbl.gov (Chris Torek) writes:
- > In article <1992Aug21.154401.5050@gw.wmich.edu> 754clifton@gw.wmich.edu writes:
- >>Assuming I have a file I have found the exact size (len) of using lseek or
- >>some other method. Assume also that I have a valid file descriptor ...
- >
- > What is a `file descriptor', and where is `lseek' in the C standard?
- >
- >> nread = read(fd, buf, len);
- >
- > You have not shown us your `read' function. Can we please keep UNIX
- > and MS-DOS and other system-specific questions to system-specific
- > groups?
- >
- > To answer the question anyway: UNIX never promised to read exactly as
- > many bytes as you ask for. Most UNIX *implementations* happen to do it
- > when the underlying file is a `disk file', but that is a side effect of
- > the implementation, not a design feature. I cannot speak for other
- > operating systems. Since you did not name the OS, the question is in
- > fact unanswerable.
- > --
- > In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 510 486 5427)
- > Berkeley, CA Domain: torek@ee.lbl.gov
-
- Sorry, I should have been more specific:
-
- 1. by `file descriptor' I mean a handle returned from open() on
- a *disk* file.
-
- 2. the OS is OS/2 2.0
-
- 3. the compiler is GCC 2.1
-
- /Doug
-