Sample code for 30+ languages & platforms
Objective-C

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 Objective-C Downloads

Objective-C
#import <CkoFileAccess.h>
#import <NSString.h>

CkoFileAccess *fac = [[CkoFileAccess alloc] init];

NSString *targetPath = [fac SymlinkTarget: @"qa_data/my_symlink"];
if (fac.LastMethodSuccess != YES) {
    NSLog(@"%@",@"Failed to get symlink target.");
    return;
}

NSLog(@"%@%@",@"target path = ",targetPath);