In the interpreter for my programming languages I have to correctly handle the parts in case the import
function is called. I then need to check if such a file is in the /libs
folder (located at the same place as my executeable!) and if it doesn't exist I have to check in the directory of the current script.
- How can I get the exact path to the directory where the executeable is located from argv?
What is the best way to remove the file from the end of a path, e.g:
C:/a/b/c/file.exe
should becomeC:/a/b/c/