What is the best way to derive your subdirectory path?

For instance, the base of my application might be:
/MyApplication/index.cfm
where "MyApplication" is a mapping in CFAdministrator

Then I have some directory structure, such that one path might be:
/MyApplication/Level1/Level2/index.cfm

I want to know where I am (reconstruct only the subdirectory
path)...that is, I want to dynamically be able to generate:
/Level1/Level2

Currently, I'm doing this via lots of string manipulation, and it seems
much more painful than it ought to be.  What I currently have is:
    <cfset RootMapping ="/MyApplication/">
    <cfset UntrimmedCurrentDirectory =
GetDirectoryFromPath(#cgi.path_info#)>
    <cfset TrimStart = Len(UntrimmedCurrentDirectory)>
    <cfset CurrentDirectory = RemoveChars(UntrimmedCurrentDirectory,
TrimStart, "1")>    {note...this takes off an extraneous character that
GetDirectoyrFromPath puts on}
    <cfset SESSION.RelativeDirectory = RemoveChars(CurrentDirectory,
"1", len(RootMapping))>

And SESSION.RelativeDirectory is what I want.

Is there a better way?  There's GOT to be a better way!

And while I'm asking, could someone explain the <BASE> tag?  Would this
help me?

Thanks!
-- Loretta Pioch

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to