mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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).
This commit is contained in:
parent
97f4a33e12
commit
6e13a562ae
5 changed files with 15 additions and 8 deletions
|
@ -264,7 +264,7 @@ extern int lstat(const char *, struct stat *);
|
|||
|
||||
/* choose the appropriate stat and fstat functions and return structs */
|
||||
#undef STAT
|
||||
#ifdef MS_WIN64
|
||||
#if defined(MS_WIN64) || defined(MS_WIN32)
|
||||
# define STAT _stati64
|
||||
# define FSTAT _fstati64
|
||||
# define STRUCT_STAT struct _stati64
|
||||
|
@ -3491,7 +3491,7 @@ static PyObject *
|
|||
posix_lseek(PyObject *self, PyObject *args)
|
||||
{
|
||||
int fd, how;
|
||||
#ifdef MS_WIN64
|
||||
#if defined(MS_WIN64) || defined(MS_WIN32)
|
||||
LONG_LONG pos, res;
|
||||
#else
|
||||
off_t pos, res;
|
||||
|
@ -3518,7 +3518,7 @@ posix_lseek(PyObject *self, PyObject *args)
|
|||
return NULL;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
#ifdef MS_WIN64
|
||||
#if defined(MS_WIN64) || defined(MS_WIN32)
|
||||
res = _lseeki64(fd, pos, how);
|
||||
#else
|
||||
res = lseek(fd, pos, how);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue