diff --git a/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatCore.C index 887fed0fd9..a089b502e3 100644 --- a/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatCore.C +++ b/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatCore.C @@ -48,7 +48,8 @@ int Foam::fileFormats::STLsurfaceFormatCore::detectBINARY { off_t dataFileSize = Foam::fileSize(filename); - istream& is = IFstream(filename, IOstream::BINARY)().stdStream(); + IFstream str(filename, IOstream::BINARY); + istream& is = str().stdStream(); // Read the STL header char header[headerSize];