ifcopenshell.write check if file was saved successfully #5809

will help only for the cases if file didn't existed before
This commit is contained in:
Andrej730
2024-11-27 12:59:03 +05:00
parent ba7b0d5c4f
commit cc014bb7ec
@@ -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)