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

Return root path of a directory

New Here ,
Jul 02, 2020 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:\ 

 

 

     

 

 

Views

200

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

 

Votes

Translate

Translate
Explorer ,
Jul 03, 2020 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

 

Iambradb.com Adobe ColdFusion Specialist.

Votes

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
community guidelines
Community Expert ,
Jul 05, 2020 Jul 05, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines
Resources
Documentation