[Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.120,2.121

Tim Peters tim_one@users.sourceforge.net
Wed, 05 Sep 2001 17:32:17 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv19489/python/Objects

Modified Files:
	fileobject.c 
Log Message:
Enable large file support on Win32 systems.
Curious:  the MS docs say stati64 etc are supported even on Win95, but
Win95 doesn't support a filesystem that allows partitions > 2 Gb.

test_largefile:  This was opening its test file in text mode.  I have no
idea how that worked under Win64, but it sure needs binary mode on Win98.
BTW, on Win98 test_largefile runs quickly (under a second).


Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.120
retrieving revision 2.121
diff -C2 -d -r2.120 -r2.121
*** fileobject.c	2001/09/05 14:58:11	2.120
--- fileobject.c	2001/09/06 00:32:15	2.121
***************
*** 368,372 ****
  		Py_BEGIN_ALLOW_THREADS
  		errno = 0;
! 		ret = _chsize(fileno(f->f_fp), newsize);
  		Py_END_ALLOW_THREADS
  		if (ret != 0) goto onioerror;
--- 368,372 ----
  		Py_BEGIN_ALLOW_THREADS
  		errno = 0;
! 		ret = _chsize(fileno(f->f_fp), (long)newsize);
  		Py_END_ALLOW_THREADS
  		if (ret != 0) goto onioerror;