<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 25, 2025 at 11:15 AM Luca Vizzarro <<a href="mailto:luca.vizzarro@arm.com" target="_blank">luca.vizzarro@arm.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
+<br>
+@overload<br>
+def make_file_path(node: Node, file_name: str, custom_path: PurePath | None = None) -> PurePath: ...<br>
+<br>
+<br>
+@overload<br>
+def make_file_path(node: None, file_name: str, custom_path: PurePath | None = None) -> Path: ...<br>
+<br>
+<br>
+def make_file_path(<br>
+    node: Node | None, file_name: str, custom_path: PurePath | None = None<br></blockquote><div><br></div><div>Maybe it makes sense to set a default value of None for node? That way people don't have to pass in None every time they want to make a path on the DTS engine system.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
+    def open(<br>
+        self, file_mode: BinaryMode | TextMode = "rb", buffering: int = -1<br>
+    ) -> Union["ArtifactFile", TextIOWrapper]:<br>
+        """Open the artifact file.<br>
+<br>
+        Args:<br>
+            file_mode: The mode of file opening.<br>
+            buffering: The size of the buffer to use. If -1, the default buffer size is used.<br>
+<br>
+        Returns:<br>
+            An instance of :class:`ArtifactFile` or :class:`TextIOWrapper`.<br>
+        """<br>
+        if self._fd is not None and not self._fd.closed:<br>
+            self._logger.warning(<br>
+                f"Artifact {self.path} is already open. Closing the previous file descriptor."<br>
+            )<br>
+            self._fd.close()<br>
+        elif not self._directories_created:<br>
+            self.mkdir()<br>
+<br>
+        # SFTPFile does not support text mode, therefore everything needs to be handled as binary.<br>
+        if "t" in file_mode:<br>
+            actual_mode = cast(BinaryMode, cast(str, file_mode).replace("t", "") + "b")<br></blockquote><div><br></div><div>Is it worth logging this event to prevent confusion? (where we change the requested mode to binary mode)</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+        elif "b" not in file_mode:<br>
+            actual_mode = cast(BinaryMode, file_mode + "b")<br></blockquote><div><br></div><div>same</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
-- <br>
2.43.0<br>
<br></blockquote><div><br></div><div>Reviewed-by: Patrick Robb <<a href="mailto:probb@iol.unh.edu">probb@iol.unh.edu</a>> </div></div></div>
</div>