home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sdd.hp.com!elroy.jpl.nasa.gov!ames!agate!dog.ee.lbl.gov!horse.ee.lbl.gov!torek
- From: torek@horse.ee.lbl.gov (Chris Torek)
- Newsgroups: comp.lang.c
- Subject: Re: Help: read() question.
- Date: 21 Aug 1992 21:08:18 GMT
- Organization: Lawrence Berkeley Laboratory, Berkeley
- Lines: 21
- Message-ID: <25663@dog.ee.lbl.gov>
- References: <1992Aug21.154401.5050@gw.wmich.edu>
- Reply-To: torek@horse.ee.lbl.gov (Chris Torek)
- NNTP-Posting-Host: 128.3.112.15
-
- 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
-