delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/05/06:56:28

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: RE: stat vs read: file sizes
5 Jul 1997 06:56:28 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <01BC8965.10B54A70.cygnus.gnu-win32@sos>
Original-To: "gnu-win32 AT cygnus DOT com" <gnu-win32 AT cygnus DOT com>,
"'Theodore W. Leung'"
<twl AT pobox DOT com>
Encoding: 17 TEXT
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019