it's kinda annoying that getDirectoryFromPath() - ...
# lucee
z
it's kinda annoying that getDirectoryFromPath() • only works on files, you can't use it to get the parent from a directory (i.e. on itself, the returned value from getDirectoryFromPath()) • also doesn't have a depth https://docs.lucee.org/reference/functions/getdirectoryfrompath.html i.e.
GetDirectoryFromPath( GetDirectoryFromPath( getCurrentTemplatePath() ) ) ==  GetDirectoryFromPath (getCurrentTemplatePath() )
https://github.com/zspitzer/Lucee/blob/6.0/core/src/main/java/lucee/runtime/functions/system/GetDirectoryFromPath.java#L38
m
Yes and no... it really doesn't make any claims to get the parent directory... maybe a getParentDirectory function is needed Pass in a file it gives the files directory else it crawls up until it can't crawl anymore
b
I understand your ask, but I think the BIF does what it says on the tin
It gets the directory portion of the path. And if there is no file, then it's the entire path!
☝️ 1
👍 1