Skip to main content
Participant
July 2, 2020
해결됨

Return root path of a directory

  • July 2, 2020
  • 2 답변들
  • 326 조회

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

 

 

     

 

 

    이 주제는 답변이 닫혔습니다.
    최고의 답변: BeRadB

    #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

     

    2 답변

    BKBK
    Community Expert
    Community Expert
    July 5, 2020

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

    BeRadB
    BeRadB답변
    Inspiring
    July 3, 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.