In which case you could simply parse through the path of the file to just obtain the path of the entire project, yes? If all you need is the path of the project, just strip out the last part which would presumably be the file itself and you would be left with what you need.
------------------------------------------------------------------------------------------------------------------------
"The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at or repair."
--Dou