[Lazarus] Absolute paths on different platforms

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Jun 27 05:43:18 CEST 2011


Sven Barth schrieb:

>> Maybe, but when I "open" an shortcut to an folder, I get the folder
>> contents, and its "properties" are the folder properties. Files may have
>> different shortcuts/symlinks, but these can be replaced by hard links,
>> in many cases (NTFS...).
> 
> But not when you use normal Windows API functions. There a shortcut file 
> looks like a normal file. Window Explorer handles them in a special way. 
> This is THE difference to symlinks. On POSIX basic APIs like "open" will 
> be applied to the target of the symlink not the symlink itself.

NTFS *Reparse Points* allow for many modifications of "normal" file 
handling, beyond POSIX capabilities, and IMO including true hard and 
symbolic links (IO_REPARSE_TAG_SYMLINK).

See also CopyFileEx, CreateHardLink, and CreateFile with e.g. 
FILE_FLAG_POSIX_SEMANTICS, COPY_FILE_COPY_SYMLINK or 
FILE_FLAG_OPEN_REPARSE_POINT.

Some of these features have been added only after W2K, as Mark 
annotated. It may be for compatibility reasons, or not-updated Explorer 
behaviour, when links and shortcuts still are stored in the old-fashion way.

DoDi





More information about the Lazarus mailing list