mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
(file_ops.c) Use retro_file everywhere in this file
This commit is contained in:
parent
c8df945792
commit
0d6b32b495
21
file_ops.c
21
file_ops.c
@ -285,8 +285,9 @@ static int read_7zip_file(
|
|||||||
outsize = outSizeProcessed;
|
outsize = outSizeProcessed;
|
||||||
if (optional_outfile != NULL)
|
if (optional_outfile != NULL)
|
||||||
{
|
{
|
||||||
FILE* outsink = fopen(optional_outfile,"wb");
|
RFILE *outsink = retro_fopen(optional_outfile, RFILE_MODE_WRITE, -1);
|
||||||
if (outsink == NULL)
|
|
||||||
|
if (!outsink)
|
||||||
{
|
{
|
||||||
RARCH_ERR("Could not open outfilepath %s.\n",
|
RARCH_ERR("Could not open outfilepath %s.\n",
|
||||||
optional_outfile);
|
optional_outfile);
|
||||||
@ -296,8 +297,8 @@ static int read_7zip_file(
|
|||||||
File_Close(&archiveStream.file);
|
File_Close(&archiveStream.file);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
fwrite(outBuffer+offset,1,outsize,outsink);
|
retro_fwrite(outsink, outBuffer + offset, outsize);
|
||||||
fclose(outsink);
|
retro_fclose(outsink);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -560,7 +561,7 @@ static int read_zip_file(const char *archive_path,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char read_buffer[RARCH_ZIP_SUPPORT_BUFFER_SIZE_MAX] = {0};
|
char read_buffer[RARCH_ZIP_SUPPORT_BUFFER_SIZE_MAX] = {0};
|
||||||
FILE* outsink = fopen(optional_outfile,"wb");
|
RFILE* outsink = retro_fopen(optional_outfile, RFILE_MODE_WRITE, -1);
|
||||||
|
|
||||||
if (outsink == NULL)
|
if (outsink == NULL)
|
||||||
goto close;
|
goto close;
|
||||||
@ -573,18 +574,18 @@ static int read_zip_file(const char *archive_path,
|
|||||||
|
|
||||||
bytes_read = unzReadCurrentFile(zipfile, read_buffer,
|
bytes_read = unzReadCurrentFile(zipfile, read_buffer,
|
||||||
RARCH_ZIP_SUPPORT_BUFFER_SIZE_MAX );
|
RARCH_ZIP_SUPPORT_BUFFER_SIZE_MAX );
|
||||||
fwrite_bytes = fwrite(read_buffer, 1, bytes_read,outsink);
|
|
||||||
|
fwrite_bytes = retro_fwrite(outsink, read_buffer, bytes_read);
|
||||||
|
|
||||||
if (fwrite_bytes == bytes_read)
|
if (fwrite_bytes == bytes_read)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* couldn't write all bytes */
|
RARCH_ERR("Error writing to %s.\n", optional_outfile);
|
||||||
RARCH_ERR("Error writing to %s.\n",optional_outfile);
|
retro_fclose(outsink);
|
||||||
fclose(outsink);
|
|
||||||
goto close;
|
goto close;
|
||||||
} while(bytes_read > 0);
|
} while(bytes_read > 0);
|
||||||
|
|
||||||
fclose(outsink);
|
retro_fclose(outsink);
|
||||||
}
|
}
|
||||||
finished_reading = true;
|
finished_reading = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user