Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-11

How to execute a command line

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hello,

I was asking myself how to execute a command line, so I went to use Unix.shell, but now it seams to be deprecated.

What should I be using instead?

Not TProcess, because I don't know the exact path of what I am calling, I would like to use something in the path.

I also need something that works on all OSes (yes, I know that UNIX unit wouldn't).

Felipe Monteiro de Carvalho
Jonas Maebe
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
I was asking myself how to execute a command line, so I went to use Unix.shell, but now it seams to be deprecated. What should I be using instead?

unix.fpsystem

Not TProcess, because I don't know the exact path of what I am calling, I would like to use something in the path.

Note that this is dangerous (it allows an attacker to override whatever you are calling with something else, simply by changing the path). Make sure this is never done from a general consumer app or something which might run with elevated privileges.

I also need something that works on all OSes (yes, I know that UNIX unit wouldn't).

There is no such OS-independent function afaik.

Jonas