Skip to content
Snippets Groups Projects
Commit ab028768 authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #5489 #5493. Explicit file paths

parent b606bd92
No related merge requests found
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <iomanip> #include <iomanip>
#include "MantidMDEvents/ImportMDEventWorkspace.h" #include "MantidMDEvents/ImportMDEventWorkspace.h"
#include "MantidKernel/ConfigService.h"
#include <Poco/Path.h>
using namespace Mantid; using namespace Mantid;
using namespace Mantid::MDEvents; using namespace Mantid::MDEvents;
...@@ -76,9 +78,12 @@ class MDFileObject ...@@ -76,9 +78,12 @@ class MDFileObject
public: public:
/// Create a simple input file. /// Create a simple input file.
MDFileObject(const FileContentsBuilder& builder = FileContentsBuilder(), std::string filename="test_import_md_event_workspace_file.txt") : m_filename(filename) MDFileObject(const FileContentsBuilder& builder = FileContentsBuilder(), std::string filename="test_import_md_event_workspace_file.txt")
{ {
m_file.open (filename.c_str()); Poco::Path path(Mantid::Kernel::ConfigService::Instance().getTempDir().c_str());
path.append(filename);
m_filename = path.toString();
m_file.open (m_filename.c_str(), std::ios_base::out);
// Invoke the builder to create the contents of the file. // Invoke the builder to create the contents of the file.
m_file << builder.create(); m_file << builder.create();
m_file.close(); m_file.close();
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <fstream> #include <fstream>
#include "MantidMDEvents/ImportMDHistoWorkspace.h" #include "MantidMDEvents/ImportMDHistoWorkspace.h"
#include "MantidAPI/IMDHistoWorkspace.h" #include "MantidAPI/IMDHistoWorkspace.h"
#include "MantidKernel/ConfigService.h"
#include <Poco/Path.h>
using namespace Mantid; using namespace Mantid;
using namespace Mantid::MDEvents; using namespace Mantid::MDEvents;
...@@ -22,9 +24,12 @@ class MDFileObject ...@@ -22,9 +24,12 @@ class MDFileObject
public: public:
/// Create a simple input file. /// Create a simple input file.
MDFileObject(const std::string& filename, const size_t& size) : m_filename(filename) MDFileObject(const std::string& filename, const size_t& size)
{ {
m_file.open (filename.c_str()); Poco::Path path(Mantid::Kernel::ConfigService::Instance().getTempDir().c_str());
path.append(filename);
m_filename = path.toString();
m_file.open (m_filename.c_str(), std::ios_base::out);
for(size_t i=1; i<size+1;++i) for(size_t i=1; i<size+1;++i)
{ {
m_file << i << "\t" << i+1 << std::endl; m_file << i << "\t" << i+1 << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment