Sample code for 30+ languages & platforms
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 C Downloads

C
#include <C_CkFileAccess.h>

void ChilkatSample(void)
    {
    HCkFileAccess fac;
    const char *targetPath;

    fac = CkFileAccess_Create();

    targetPath = CkFileAccess_symlinkTarget(fac,"qa_data/my_symlink");
    if (CkFileAccess_getLastMethodSuccess(fac) != TRUE) {
        printf("Failed to get symlink target.\n");
        CkFileAccess_Dispose(fac);
        return;
    }

    printf("target path = %s\n",targetPath);


    CkFileAccess_Dispose(fac);

    }