home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!yale.edu!yale!gumby!wmichgw!754clifton
- From: 754clifton@gw.wmich.edu
- Newsgroups: comp.lang.c
- Subject: Help: read() question.
- Message-ID: <1992Aug21.154401.5050@gw.wmich.edu>
- Date: 21 Aug 92 15:44:01 EST
- Organization: Western Michigan University
- Lines: 16
-
- 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, and a
- char *buf allocated to hold the data, shouldn't the call:
-
- nread = read(fd, buf, len);
-
- return (nread) the same number of bytes as the length? ie. nread == len if
- there where no errors from read? In a bug search I am working on this call`
- returns *1 less* than the number of bytes in the file, which screws-up the
- error checking on the file that the code is indended for.
-
- Thanks for any advice,
-
- /Doug
- --
- Douglas Clifton [99clifto@lab.cc.wmich.edu]
-