Delphi DLL
Delphi DLL
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 Delphi DLL Downloads
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, FileAccess;
...
procedure TForm1.Button1Click(Sender: TObject);
var
fac: HCkFileAccess;
targetPath: PWideChar;
begin
fac := CkFileAccess_Create();
targetPath := CkFileAccess__symlinkTarget(fac,'qa_data/my_symlink');
if (CkFileAccess_getLastMethodSuccess(fac) <> True) then
begin
Memo1.Lines.Add('Failed to get symlink target.');
Exit;
end;
Memo1.Lines.Add('target path = ' + targetPath);
CkFileAccess_Dispose(fac);
end;