--- a/src/eric7/SystemUtilities/FileSystemUtilities.py Thu Dec 07 10:40:51 2023 +0100 +++ b/src/eric7/SystemUtilities/FileSystemUtilities.py Sun Dec 10 17:06:00 2023 +0100 @@ -729,6 +729,31 @@ return mountedPaths +def startfile(filePath): + """ + Function to open the given file path with the system default application. + + @param filePath file path to be opened + @type str or Path + @return flag indicating a successful start of the associated application + @rtype bool + """ + filePath = str(filePath) + + if OSUtilities.isWindowsPlatform(): + return os.startfile(filePath) # secok + + elif OSUtilities.isMacPlatform(): + return subprocess.call(("open", filePath)) # secok + + elif OSUtilities.isLinuxPlatform() or OSUtilities.isFreeBsdPlatform(): + return subprocess.call(("xdg-open", filePath)) # secok + + else: + # unsupported platform + return False + + ################################################################################ ## Functions below handle (MicroPython) device and remote file names. ################################################################################