FIX: Show correctly symlinks to files (Vista/Seven)

This commit is contained in:
Alexander Koblov 2010-03-08 12:21:19 +00:00
commit 628a9d7bb8
3 changed files with 7 additions and 5 deletions

View file

@ -124,10 +124,8 @@ begin
WinFileTimeToDateTime(SearchRecord.FindData.ftCreationTime));
FLastAccessTime := TFileLastAccessDateTimeProperty.Create(
WinFileTimeToDateTime(SearchRecord.FindData.ftLastAccessTime));
//Other times: SearchRecord.FindData.ftCreationTime
//Because symbolic link works on Windows 2k/XP for directories only
FIsLinkToDirectory := FAttributes.IsLink;
FIsLinkToDirectory := FAttributes.IsLink and FAttributes.IsDirectory;
{$ELSEIF DEFINED(UNIX)}

View file

@ -694,7 +694,7 @@ begin
try
wPath:= UTF8Decode(Path);
wLinkName:= UTF8Decode(LinkName);
uNTFSLinks.CreateSymlink(wPath, wLinkName);
Result:= uNTFSLinks.CreateSymlink(wPath, wLinkName);
except
Result := False;
end;

View file

@ -70,7 +70,11 @@ const
'Distributed File System point'
);
(* To create symbolic link (works on Windows 2k/XP for directories only) *)
{en
Create symbolic link on NTFS drive
On Windows 2k/XP works for directories only
On Windows Vista/Seven works for files and directories
}
function CreateSymlink(ATargetName, ALinkName: WideString): Boolean;
(* To create hardlink(s) (works only for files) *)
procedure CreateHardlink(AFileName, ALinkName: WideString);