TProcess on OS X and Linux

Started by Yellownakji, May 03, 2019, 12:25:39

Previous topic - Next topic

Yellownakji

Hi,

A feature i'm working on, from my project, utilize TPROCESS on Windows.   How can i replicate this functionality on *nix?


?Win32
     If FileType("C:\Windows\notepad.exe")
          Local process:TProcess = TProcess.Create("c:\windows\notepad.exe " + InjectDir:String + "\META-INF\MANIFEST.MF", 0)
     end if
?


I'm not sure exactly what the default text editors are on these platforms.  For Windows it's 'notepad.exe' and 'write.exe'.    For linux and OS X, my main issue is the file system.  I don't think these OS have drives like "C:" but instead 'mount points', e.g. '/home/...' (for linux, anyways.)

I'm confused on what path i need to exactly specify. (OS install root)

Yellownakji

In Linux, i see '/usr/share/applications', which indeed has 'Text Editor'.   However, text editor does not have a file extension, do i cannot get it to detect with filetype().

In this folder, there is also a 'mime.cache' file, and this DOES detect, presumably due to the '.cache' part.    I tried '.desktop', but that didn't do anything, either.

Advice?  I *need* to be able to open a file with Text Editor via TProcess.

Derron

X11 utilizing distros might have
xdg-open file.ext


Bye
Ron