; Module/File: System_OpenWithStandardApp.pb ; Function: Open with Standardprogramm - Linux ; Author: Omi ; Date: Sep. 16, 2014 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- ;INFO! ProgramID delivers the ID from xdg-open/gnome-open, so you can't do a remote-kill, write, read, ... to the default-application! ;If necessary see 'System_DefaultApplicationRead+Open.pb' Procedure FileExist(FName.s) Protected.i Ret= #True If FileSize(FName) < 0 Ret=#False EndIf ProcedureReturn Ret EndProcedure Procedure.i RunStandardProgram(File.s, Work.s, Flags= 0, Sender= 0) Protected.i Ret ;If Not FileExist(File) : ProcedureReturn Ret : EndIf Ret= RunProgram("xdg-open", File, Work, Flags, Sender) If Ret= #Null Ret= RunProgram("gnome-open", File, Work, Flags, Sender) EndIf ProcedureReturn Ret EndProcedure RunStandardProgram(#DQUOTE$ + "/home/charly/Programming/Programm/Others/Electronic2/E-T.pdf" + #DQUOTE$, GetCurrentDirectory(), Flags, 0) ;RunStandardProgram(#DQUOTE$ + #PB_Compiler_Home + "examples/sources/Data/Background.bmp" + #DQUOTE$, GetCurrentDirectory(), Flags, 0) ;RunStandardProgram(#DQUOTE$ + #PB_Compiler_Home + "/compilers/apifunctions.txt" + #DQUOTE$, GetCurrentDirectory(), Flags, 0) ; Debug RunStandardProgram(#DQUOTE$ + "http://www.chabba.de" + #DQUOTE$, GetCurrentDirectory(), Flags, 0) ; IDE Options = PureBasic 5.44 LTS (Linux - x86) ; CursorPosition = 31 ; Folding = - ; EnableUnicode ; EnableXP