| 1 |
diff --git a/dolfin/io/File.cpp b/dolfin/io/File.cpp |
| 2 |
index 7ad5a7422..bc748a4b5 100644 |
| 3 |
--- a/dolfin/io/File.cpp |
| 4 |
+++ b/dolfin/io/File.cpp |
| 5 |
@@ -147,14 +147,13 @@ void File::init(MPI_Comm comm, const std::string filename, |
| 6 |
|
| 7 |
// Get file path and extension |
| 8 |
const boost::filesystem::path path(filename); |
| 9 |
- const std::string extension = boost::filesystem::extension(path); |
| 10 |
+ const std::string extension = path.extension().string(); |
| 11 |
|
| 12 |
// Choose format based on extension |
| 13 |
if (extension == ".gz") |
| 14 |
{ |
| 15 |
// Get suffix after discarding .gz |
| 16 |
- const std::string ext = |
| 17 |
- boost::filesystem::extension(boost::filesystem::basename(path)); |
| 18 |
+ const std::string ext = path.stem().extension().string(); |
| 19 |
if (ext == ".xml") |
| 20 |
_file.reset(new XMLFile(comm, filename)); |
| 21 |
else |
| 22 |
diff --git a/dolfin/io/XMLFile.cpp b/dolfin/io/XMLFile.cpp |
| 23 |
index 4c62f7b84..023f6a1d9 100644 |
| 24 |
--- a/dolfin/io/XMLFile.cpp |
| 25 |
+++ b/dolfin/io/XMLFile.cpp |
| 26 |
@@ -400,7 +400,7 @@ void XMLFile::load_xml_doc(pugi::xml_document& xml_doc) const |
| 27 |
|
| 28 |
// Get file path and extension |
| 29 |
const boost::filesystem::path path(_filename); |
| 30 |
- const std::string extension = boost::filesystem::extension(path); |
| 31 |
+ const std::string extension = path.extension().string(); |
| 32 |
|
| 33 |
// Check that file exists |
| 34 |
if (!boost::filesystem::is_regular_file(_filename)) |
| 35 |
@@ -464,7 +464,7 @@ void XMLFile::save_xml_doc(const pugi::xml_document& xml_doc) const |
| 36 |
{ |
| 37 |
// Compress if filename has extension '.gz' |
| 38 |
const boost::filesystem::path path(_filename); |
| 39 |
- const std::string extension = boost::filesystem::extension(path); |
| 40 |
+ const std::string extension = path.extension().string(); |
| 41 |
if (extension == ".gz") |
| 42 |
{ |
| 43 |
std::stringstream xml_stream; |