Sample code for 30+ languages & platforms
Swift

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

Swift

func chilkatTest() {
    let fac = CkoFileAccess()!

    var targetPath: String? = fac.symlinkTarget(linkPath: "qa_data/my_symlink")
    if fac.lastMethodSuccess != true {
        print("Failed to get symlink target.")
        return
    }

    print("target path = \(targetPath!)")

}