diff -r 5e6362665247 -r 6e790462348a src/eric7/MicroPython/Devices/DeviceBase.py --- a/src/eric7/MicroPython/Devices/DeviceBase.py Fri Jan 19 09:50:47 2024 +0100 +++ b/src/eric7/MicroPython/Devices/DeviceBase.py Sat Jan 20 12:36:40 2024 +0100 @@ -822,6 +822,28 @@ if err: raise OSError(self._shortError(err)) + def rename(self, oldname, newname): + """ + Public method to rename a file on the device. + + @param oldname current name of the file + @type str + @param newname new name for the file + @type str + @exception OSError raised to indicate an issue with the device + """ + if oldname and newname: + command = """ +import os as __os_ +__os_.rename('{0}', '{1}') +del __os_ +""".format( + oldname, newname + ) + out, err = self.executeCommands(command, mode=self._submitMode) + if err: + raise OSError(self._shortError(err)) + def put(self, hostFileName, deviceFileName=None): """ Public method to copy a local file to the connected device.