This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
istream tellg causes loss of characters
- To: <cygwin at cygwin dot com>
- Subject: istream tellg causes loss of characters
- From: "Hao Huang" <hhuang at cs dot columbia dot edu>
- Date: Wed, 7 Mar 2001 17:27:21 -0500
The following code demonstrate the bug. The code produces correct result on
Solaris/Linux. The tellg (with or without call to gcount) cause some characters
to be lost. The exact number of characters changes if the file/line changes.
string line;
ifstream in("test");
getline(in, line);
cout << ":: " << line << endl;
cout << "gcount = " << in.gcount() << endl;
size_t pos = in.tellg();
cout << "remember " << pos << endl;
while (getline(in, line)) cout << "0: " << line << endl;
//////////// OUTPUT
:: gene alpha_0X alpha_7X alpha_14X
gcount = 0
remember 37
0: 001C -0.38 -0.38 -0.43
/////////// File test
gene alpha_0X alpha_7X alpha_14X
YAL001C -0.38 -0.38 -0.43
----------------------------------------
>gcc --version
2.95.2-6
>cygcheck -s -v -r
Cygnus Win95/NT Configuration Diagnostics
Current System Time: Wed Mar 7 17:24:29 2001
WinNT Ver 5.0 build 2195 Service Pack 1
Path: //e/java/jbuilder/jdk1.3/bin
/usr/local/bin
/usr/bin
/usr/sbin
/usr/X11R6/bin
/sbin
/bin
//c/WINNT
//c/WINNT/system32
/cygdrive/d/hh/bin/script
.
SysDir: C:\WINNT\System32
WinDir: C:\WINNT
PWD = `/cygdrive/d'
LD_LIBRARY_PATH = `/usr/local/lib:/usr/lib:/lib:.'
USER = `hh'
MAKE_MODE = `unix'
HOME = `/cygdrive/d/hh'
NUMBER_OF_PROCESSORS = `1'
PROMPT = `$P$G'
LESSBINFMT = `*n%c'
command_oriented_history = `yes'
LOGONSERVER = `\\TOM'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
OS_RELE_ARCH = `CYGWIN_NT-5.0_1.1.8'
COMSPEC = `C:\WINNT\system32\cmd.exe'
TOOK_ENV = `yes'
SYSTEMDRIVE = `C:'
HOSTNAME = `TOM'
PROCESSOR_REVISION = `0303'
MAILCHECK = `30'
notify = `yes'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
COMPUTERNAME = `TOM'
!E: = `E:\cygwin\bin'
WINDIR = `C:\WINNT'
CLASSPATH = `e:\java\jbuilder\jdk1.3\jre\lib\rt.jar;.'
USERPROFILE = `C:\Documents and Settings\hh'
MANPATH =
`/usr/local/man:/usr/man:/usr/local/linux-man:/usr/local/perl-man:/cygdrive/d/hh
/bin/man'
PS1 = `\w>'
ENV = `/cygdrive/d/hh/.kshrc'
PROGRAMFILES = `C:\Program Files'
LESS = `-dfM'
MACHTYPE = `i686-pc-cygwin'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 3 Stepping 3, GenuineIntel'
OS = `Windows_NT'
OLDPWD = `//d'
CVS_RSH = `ssh'
PROCESSOR_ARCHITECTURE = `x86'
TEMP = `/cygdrive/c/TEMP'
EDITOR = `emacs'
PROCESSOR_LEVEL = `6'
SYSTEMROOT = `C:\WINNT'
HOST = `TOM'
JAVA_HOME = `//e/java/jbuilder/jdk1.3'
HOMEDRIVE = `d:'
ALLUSERSPROFILE = `C:\Documents and Settings\All Users'
SHLVL = `1'
APPDATA = `C:\Documents and Settings\hh\Application Data'
COMMONPROGRAMFILES = `C:\Program Files\Common Files'
HOMEPATH = `\hh'
USERDOMAIN = `TOM'
USERNAME = `hh'
SHELL = `/bin/sh'
HOSTTYPE = `i686'
CDPATH = `.:/cygdrive/d/hh'
OSTYPE = `cygwin'
TERM = `cygwin'
_ = `/usr/bin/cygcheck'
TZ = `EST5EDT4,M4.1.0/2,M10.5.0/2'
HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\S
tart Menu\
Programs\Cygnus Solutions
(default) = (unsupported type)
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
(default) = `/cygdrive'
cygdrive flags = 0x00000028
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
(default) = `e:\cygwin'
flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/tmp
(default) = `d:\tmp'
flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
(default) = `e:/cygwin/bin'
flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
(default) = `e:/cygwin/lib'
flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options
a: fd N/A N/A
c: hd NTFS 1827Mb 83% CP CS UN PA FC Win
d: hd FAT32 1025Mb 76% CP UN USER
e: hd NTFS 2047Mb 81% CP CS UN PA FC App
g: hd NTFS 3522Mb 33% CP CS UN PA FC Game
m: hd NTFS 34232Mb 33% CP CS UN PA FC Media
t: hd FAT 250Mb 84% CP UN BOOT
v: cd N/A N/A
w: cd N/A N/A
z: fd N/A N/A
e:\cygwin\bin /usr/bin system binmode
e:\cygwin\lib /usr/lib system binmode
e:\cygwin / system binmode
d:\tmp /tmp system textmode
Found: e:\cygwin\bin\bash.exe
Found: e:\cygwin\bin\cat.exe
Found: e:\cygwin\bin\cpp.exe
Found: e:\cygwin\bin\find.exe
Found: e:\cygwin\bin\gcc.exe
Found: e:\cygwin\bin\gdb.exe
Found: e:\cygwin\bin\ld.exe
Found: e:\cygwin\bin\ls.exe
Found: e:\cygwin\bin\make.exe
Found: e:\cygwin\bin\sh.exe
56k 2000/12/03 e:\cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0
"cygbz21.0.dll" v0.0 ts=2000/11/20 18:53
82k 2001/01/21 e:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
"cygform5.dll" v0.0 ts=2001/1/21 15:39
18k 2000/10/23 e:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
"cyggdbm.dll" v0.0 ts=2000/10/22 22:26
17k 2001/01/07 e:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
"cyghistory4.dll" v0.0 ts=2001/1/6 23:34
14k 2000/10/23 e:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0
"cygintl.dll" v0.0 ts=2000/10/23 15:02
81k 2000/12/05 e:\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
"cygitcl30.dll" v0.0 ts=2000/11/25 20:43
35k 2000/12/05 e:\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
"cygitk30.dll" v0.0 ts=2000/11/25 20:43
45k 2000/10/22 e:\cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0
"cygjbig1.dll" v0.0 ts=2000/10/22 19:06
119k 2000/10/23 e:\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0
"cygjpeg6b.dll" v0.0 ts=2000/10/22 20:58
53k 2001/01/21 e:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
"cygmenu5.dll" v0.0 ts=2001/1/21 15:39
414k 2001/01/21 e:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
"cygncurses++5.dll" v0.0 ts=2001/1/21 15:40
299k 2001/01/21 e:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
"cygncurses5.dll" v0.0 ts=2001/1/21 15:38
34k 2001/01/21 e:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
"cygpanel5.dll" v0.0 ts=2001/1/21 15:38
163k 2001/02/03 e:\cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0
"cygpng2.dll" v0.0 ts=2001/2/3 16:21
108k 2001/01/07 e:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
"cygreadline4.dll" v0.0 ts=2001/1/6 23:34
390k 2001/01/18 e:\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
"cygtcl80.dll" v0.0 ts=2001/1/17 23:44
5k 2001/01/18 e:\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
10k 2001/01/18 e:\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
"cygtclreg80.dll" v0.0 ts=2001/1/17 23:44
243k 2000/10/23 e:\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0
"cygtiff3.dll" v0.0 ts=2000/10/22 21:14
623k 2000/12/05 e:\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
"cygtk80.dll" v0.0 ts=2000/11/25 20:43
41k 2000/11/20 e:\cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0
"cygXpm-noX4.dll" v0.0 ts=2000/11/19 21:41
45k 2000/11/20 e:\cygwin\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0
"cygXpm-X4.dll" v0.0 ts=2000/11/19 21:45
49k 2001/02/03 e:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
"cygz.dll" v0.0 ts=2001/2/3 15:35
615k 2001/01/31 e:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
"cygwin1.dll" v0.0 ts=2001/1/31 10:08
Cygwin DLL version info:
dll major: 1001
dll minor: 8
dll epoch: 19
dll bad signal mask: 19005
dll old termios: 5
dll malloc env: 28
api major: 0
api minor: 34
shared data: 3
dll identifier: cygwin1
mount registry: 2
cygnus registry name: Cygnus Solutions
cygwin registry name: Cygwin
program options name: Program Options
cygwin mount registry name: mounts v2
cygdrive flags: cygdrive flags
cygdrive prefix: cygdrive prefix
cygdrive default prefix:
build date: Wed Jan 31 10:08:38 EST 2001
shared id: cygwin1S3
Use -h to see help about each section
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple