May 24, 2019, 11:17:17 PM

Author Topic: TProcess on OS X and Linux  (Read 61 times)

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 216
  • Whoop-de-doo-ba-dooo!
TProcess on OS X and Linux
« on: May 03, 2019, 12:25:39 PM »
Hi,

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

Code: [Select]
?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)

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 216
  • Whoop-de-doo-ba-dooo!
Re: TProcess on OS X and Linux
« Reply #1 on: May 03, 2019, 03:36:12 PM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2087
Re: TProcess on OS X and Linux
« Reply #2 on: May 03, 2019, 04:36:40 PM »
X11 utilizing distros might have
xdg-open file.ext


Bye
Ron