diff --git a/src/Mod/Import/App/dxf.cpp b/src/Mod/Import/App/dxf.cpp
index 19e116beac..65d96bfb57 100644
--- a/src/Mod/Import/App/dxf.cpp
+++ b/src/Mod/Import/App/dxf.cpp
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include
#include "dxf.h"
@@ -47,7 +48,8 @@ m_layerName("none")
// start the file
m_fail = false;
m_version = 12;
- m_ofs = new ofstream(filepath, ios::out);
+ Base::FileInfo fi(filepath);
+ m_ofs = new Base::ofstream(fi, ios::out);
m_ssBlock = new std::ostringstream();
m_ssBlkRecord = new std::ostringstream();
m_ssEntity = new std::ostringstream();