mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-07 12:56:26 +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":
|
if format == ".ifcZIP":
|
||||||
return self.write(path, ".ifc", zipped=True)
|
return self.write(path, ".ifc", zipped=True)
|
||||||
self.wrapped_data.write(str(path))
|
self.wrapped_data.write(str(path))
|
||||||
|
if not path.exists():
|
||||||
|
raise PermissionError(f"Failed to write to '{path}', check folder permissions.")
|
||||||
if zipped:
|
if zipped:
|
||||||
unzipped_path = path.with_suffix(format)
|
unzipped_path = path.with_suffix(format)
|
||||||
path.rename(unzipped_path)
|
path.rename(unzipped_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user