Why File::getPathUpToLastSlash() is private member?


#1

hello Jules,

is here a special reason why this function is declared as private ?

I often use such function to get the real path part from a  file name. Now I needed this Juce again.

 

regards

 elli


#2

Why don’t you use File::getParentDirectory() instead?


#3

Yes - it's a bad idea to work directly with strings when manipulating paths. Always work via the File class, and it'll save you from a lot of pitfalls.


#4

you are right, I was confused about the name "getParentDirectory()". Now it works as expected.