diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-02-21 08:44:05 -0800 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-02-21 08:44:05 -0800 |
commit | f2f373f5931be48efc3f6fa2c2faa1cca79dce75 (patch) | |
tree | 87facdec6423b6282ad5c4e2cf30e124d4a5de40 /Modules/main.c | |
parent | 18d1924987d75ef43a429fe4b6f05df2c308ec2a (diff) | |
download | cpython-git-f2f373f5931be48efc3f6fa2c2faa1cca79dce75.tar.gz |
Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on Windows.
fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
Diffstat (limited to 'Modules/main.c')
-rw-r--r-- | Modules/main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/main.c b/Modules/main.c index c4883c95ed..83538c42e0 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -752,9 +752,8 @@ Py_Main(int argc, wchar_t **argv) } } { - /* XXX: does this work on Win/Win64? (see posix_fstat) */ - struct stat sb; - if (fstat(fileno(fp), &sb) == 0 && + struct _Py_stat_struct sb; + if (_Py_fstat(fileno(fp), &sb) == 0 && S_ISDIR(sb.st_mode)) { fprintf(stderr, "%ls: '%ls' is a directory, cannot continue\n", argv[0], filename); fclose(fp); |