diff --git a/src/ifcopenshell-python/ifcopenshell/file.py b/src/ifcopenshell-python/ifcopenshell/file.py index db450e3ff0..228c0e9749 100644 --- a/src/ifcopenshell-python/ifcopenshell/file.py +++ b/src/ifcopenshell-python/ifcopenshell/file.py @@ -673,6 +673,8 @@ class file: if format == ".ifcZIP": return self.write(path, ".ifc", zipped=True) self.wrapped_data.write(str(path)) + if not path.exists(): + raise PermissionError(f"Failed to write to '{path}', check folder permissions.") if zipped: unzipped_path = path.with_suffix(format) path.rename(unzipped_path)