How can I determine whether a particular folder in the PATH environment variable is used by the system?
Recently, some software that relied on the system PATH stopped working b/c another package added too many characters to the beginning the variable, causing important parts to be truncated at the end.
This led me to cleaning up the variable by removing some unused directories and shortening others; however, I still have quite a bit left over that I'm unsure of and I'm wondering if there is a way to determine whether certain parts of the PATH variable are used/unused by any process on the system.
Ideally I would love a list of dependencies, however, I would be happy with a method that can log failed/successful attempts. Any ideas?
EDIT
My goal is to determine if it's safe to remove a directory from PATH without breaking anything, therefore I need to know if a file was accessed specifically by looking it up in the PATH.
Answer
There is no reliable way to ensure this. For example an application can insert the custom path while it is installed, and not log it anywhere else, even in it's own settings/files. In this case there is no way to search anywhere else to ensure it is needed or not, and if you remove the path entry it is going to break.
That is about making sure 100% , in practical cases you can remove any entries related to uninstalled programs and directories which no longer exists with a good level of confidence.
No comments:
Post a Comment