src/eric7/MicroPython/MicroPythonFileManager.py

branch
eric7
changeset 9852
b7aef103355a
parent 9766
f0e22f3a5878
child 9853
080e060a0383
--- a/src/eric7/MicroPython/MicroPythonFileManager.py	Mon Mar 06 09:50:18 2023 +0100
+++ b/src/eric7/MicroPython/MicroPythonFileManager.py	Mon Mar 06 11:39:26 2023 +0100
@@ -81,6 +81,21 @@
 
         self.__device = device
 
+    def exists(self, pathname):
+        """
+        Public method to check the existence of a file or directory.
+
+        @param pathname name of the path to check
+        @type str
+        @return flag indicating the existence
+        @rtype bool
+        """
+        try:
+            return self.__device.exists(pathname)
+        except Exception as exc:
+            self.error.emit("exists", str(exc))
+            return False
+
     @pyqtSlot(str)
     def lls(self, dirname, showHidden=False):
         """

eric ide

mercurial