I have a project where I want to read a file with data which lies in a specific folder. I have a script file to execute the program, and this script file can lie anywhere on the computer, hence I cannot use the function getcwd in the program to get the path for my data file. My question is, is there any possibility in C to get the path from where the objective file is located. I.e. not where the script is run from?
Example: Directory of start script: /home/user/my_files/scripts/start_script.sh Directory of main routine: /home/user/project/