mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user