From: twl@pobox.com ("Theodore W. Leung")
Subject: stat vs read: file sizes
5 Jul 1997 01:21:42 -0700
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <3.0.2.32.19970705003748.009bd770.cygnus.gnu-win32@ng.netgate.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Sender: twl@ng.netgate.net (Unverified)
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.2 (32)
Original-To: gnu-win32@cygnus.com
Original-Sender: owner-gnu-win32@cygnus.com

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?

Thanks,

Ted
______________________________________________________________________________
Ted Leung	twl@pobox.com or twl@alum.mit.edu      http://pobox.com/~twl
______________________________________________________________________________

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQBtAzKVWM8AAAEDAMcGqhQaOwR3lZGSRWXPGValB1dyZM+uWPlzwnIoaL5an8Do
wkvXEfMWCVkiuHQW4yh631RSHFvrftgVvJgKXB1+WYMDDP1V7nGeemT5EF3oUIU0
BxdTSRd3c841lLe5TQAFEbQhVGhlb2RvcmUgVy4gTGV1bmcgPHR3bEBwb2JveC5j
b20+
=U9O6
-----END PGP PUBLIC KEY BLOCK-----
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
