Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Return root path of a directory

New Here ,
Jul 02, 2020 Jul 02, 2020

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:\ 

 

 

     

 

 

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

correct answers 1 Correct answer

Explorer , Jul 03, 2020 Jul 03, 2020

#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

 

Translate
Explorer ,
Jul 03, 2020 Jul 03, 2020

#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

 

Iambradb.com Adobe ColdFusion Specialist.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 05, 2020 Jul 05, 2020
LATEST

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

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