mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Co-authored-by: theseyan <sayanjyotidasworkmail@gmai.com>
This commit is contained in:
@@ -675,6 +675,7 @@ class file:
|
||||
"""
|
||||
path = Path(path)
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
if format == None:
|
||||
format = ifcopenshell.guess_format(path)
|
||||
if format == ".ifcXML":
|
||||
@@ -690,8 +691,7 @@ 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