Highlighted

Return root path of a directory

New Here ,
Jul 02, 2020

Copy link to clipboard

Copied

Hello community

I have been researching routes in ColdFusion and I want to know if there is any function that returns the root node of the directory.

Example: C:\mydirectory\myotherdirectory  

output:   C:\         

 

Example: D:\mydirectory\myotherdirectory  

output:   D:\ 

 

 

     

 

 

#listfirst(expandpath('./'),'/')#

 

this should return the 'c:' part of the current directory

 

please note this might not work if you are in a shared environment.

 

and not too sure this will work on Linux

 

Views

44

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Return root path of a directory

New Here ,
Jul 02, 2020

Copy link to clipboard

Copied

Hello community

I have been researching routes in ColdFusion and I want to know if there is any function that returns the root node of the directory.

Example: C:\mydirectory\myotherdirectory  

output:   C:\         

 

Example: D:\mydirectory\myotherdirectory  

output:   D:\ 

 

 

     

 

 

#listfirst(expandpath('./'),'/')#

 

this should return the 'c:' part of the current directory

 

please note this might not work if you are in a shared environment.

 

and not too sure this will work on Linux

 

Views

45

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 02, 2020 0
Explorer ,
Jul 03, 2020

Copy link to clipboard

Copied

#listfirst(expandpath('./'),'/')#

 

this should return the 'c:' part of the current directory

 

please note this might not work if you are in a shared environment.

 

and not too sure this will work on Linux

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 03, 2020 1
BKBK LATEST
Adobe Community Professional ,
Jul 05, 2020

Copy link to clipboard

Copied

createobject("java", "java.lang.System").getenv("SystemDrive")

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 05, 2020 1