Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the parent of the current file?

To get the current *.cfm file I use:

GetFileFromPath(GetCurrentTemplatePath())

Is there a simple way to get the parent of the current file?

I.e. if the current file is ...\MyApp\Users\addUser.cfm I want to return Users.

Edit: the reason I want to do this is to check for access permission. Depending on path different policies will be enforced.

Edit: The linked question doesn't provide the correct answer.

like image 515
Roland Avatar asked Jan 08 '23 22:01

Roland


1 Answers

GetFileFromPath(GetFileInfo(GetCurrentTemplatePath()).parent)

This will return exactly what I need. Using the example from the question: just Users withouth the full path.

like image 119
Roland Avatar answered Jan 16 '23 18:01

Roland