vendredi 26 août 2016

How to know the called program path in C/C++ in Linux?

I am having a compiled C program say test in /usr/bin and a python program say pgm.py is in /opt/python/ . In pgm.py , I am calling the C program like os.system("test arg1 arg2") . Is it possible for the C program to know that it is being called by /opt/python/pgm.py ?

Aucun commentaire:

Enregistrer un commentaire