mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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.
This commit is contained in:
parent
18d1924987
commit
f2f373f593
12 changed files with 242 additions and 180 deletions
|
@ -35,7 +35,7 @@ main(int argc, char *argv[])
|
|||
{
|
||||
char *inpath, *outpath;
|
||||
FILE *infile = NULL, *outfile = NULL;
|
||||
struct stat st;
|
||||
struct _Py_stat_struct st;
|
||||
size_t text_size, data_size, n;
|
||||
char *text = NULL;
|
||||
unsigned char *data;
|
||||
|
@ -54,7 +54,7 @@ main(int argc, char *argv[])
|
|||
fprintf(stderr, "cannot open '%s' for reading\n", inpath);
|
||||
goto error;
|
||||
}
|
||||
if (fstat(fileno(infile), &st)) {
|
||||
if (_Py_fstat(fileno(infile), &st)) {
|
||||
fprintf(stderr, "cannot fstat '%s'\n", inpath);
|
||||
goto error;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue