This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: stat vs read: file sizes


Theodore W. Leung wrote:
> I've been working on porting glimpse to GNU-Win32, and I've run into a
> problem.  glimpse uses a technique where stat is called to determine the
> file size, S, and then read is called to read S bytes from the file.  The 
> problem is that reading S bytes from the file returns a size T less than S.
> This number appears to be off by the number of lines in the file (as
> reported by NTEmacs).  I'm guessing that there is some CR/LF mapping going
> on behind the
> scenes.  Short of rewriting the glimpse code, is there a way/mode to handle
> this?

Use binary mode mounts to avoid the problem. Do you really need cr/lfs instead of single lf?

-- 
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]