Sample code for 30+ languages & platforms
DataFlex

Get the Target of a Symbolic Link

See more FileAccess Examples

Demonstrates how to get the target of a symbolic link.

Note: This example requires Chilkat v9.5.0.77 or greater.

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoFac
    String sTargetPath
    Boolean bTemp1

    Get Create (RefClass(cComCkFileAccess)) To hoFac
    If (Not(IsComObjectCreated(hoFac))) Begin
        Send CreateComObject of hoFac
    End

    Get ComSymlinkTarget Of hoFac "qa_data/my_symlink" To sTargetPath
    Get ComLastMethodSuccess Of hoFac To bTemp1
    If (bTemp1 <> True) Begin
        Showln "Failed to get symlink target."
        Procedure_Return
    End

    Showln "target path = " sTargetPath


End_Procedure