home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12654 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  1.6 KB

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