summaryrefslogtreecommitdiff
path: root/Source/Core/Common/IOFile.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2023-10-01 11:39:37 -0400
committerGitHub <noreply@github.com>2023-10-01 11:39:37 -0400
commitcd366c4f46dad509b959a05afad3847218ffe5f6 (patch)
treef8baa6b501072d3402ad9462a6c556e419b75a0b /Source/Core/Common/IOFile.cpp
parentd55d878b178b57f1aa4b0eb6235194d44c6c6f6b (diff)
parent335cf4f2db4160ebbf387aeb19dc637182c91c5a (diff)
Merge pull request #12036 from LillyJadeKatrin/deep-copy-volume
Added CopyReader to BlobReader and all subclasses
Diffstat (limited to 'Source/Core/Common/IOFile.cpp')
-rw-r--r--Source/Core/Common/IOFile.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/Common/IOFile.cpp b/Source/Core/Common/IOFile.cpp
index cf7762ea68..cc22979bbe 100644
--- a/Source/Core/Common/IOFile.cpp
+++ b/Source/Core/Common/IOFile.cpp
@@ -101,6 +101,15 @@ bool IOFile::Close()
return m_good;
}
+IOFile IOFile::Duplicate(const char openmode[]) const
+{
+#ifdef _WIN32
+ return IOFile(_fdopen(_dup(_fileno(m_file)), openmode));
+#else // _WIN32
+ return IOFile(fdopen(dup(fileno(m_file)), openmode));
+#endif // _WIN32
+}
+
void IOFile::SetHandle(std::FILE* file)
{
Close();