[Lazarus] Absolute paths on different platforms
Sven Barth
pascaldragon at googlemail.com
Sun Jun 26 13:52:05 CEST 2011
On 26.06.2011 13:50, Hans-Peter Diettrich wrote:
> Mark Morgan Lloyd schrieb:
>
>> Does Windows still support commands like "subst" and "join"?
>
> A friend uses SUBST e.g. for his own libraries, and he cannot use
> FPC/Lazarus because these are unable to find his files in e.g. X:\.
>
Why can't he use that? SUBST uses the same mechanism that is used for
e.g. C:\ so all folders that are mapped using SUBST (or its underlying
API) are accessible the same way from the Windows API as "normal" drives
are.
>> Alternatively I believe that it does now have an equivalent of
>> symlinks for directories.
>
> NT is POSIX compatible, at least with regards to files and inodes.
> Symlinks exist since the introduction of desktop shortcuts/icons and the
> Windows Explorer, in all file systems. The implementation (of symlinks
> and SUBST) may vary, though, depending on the concrete filesystem.
But shortcuts aren't the same as symlinks. Shortcuts are normal files
and they can be opened like that using e.g. OpenFile while you need to
use special APIs to work on symlinks.
If you want something that is more like POSIX' symlink concept then you
either need to look at the newer features provided by NTFS file systems
and Windows versions like Vista and younger or you need to look at NT's
object manager which can be accessed using the Native NT API and
provides a virtual, object based root filesystem similar to that you can
find on POSIX systems. You can also have symlinks there and in the end
the drives you can see through the Window API (C:\, etc) are symlinks
from the global WinAPI namespace (e.g. \Global??\C [yes, the "??" belong
there]) to the correct partition (e.g. \Devices\Harddisk1\HarddiskVolume0).
Regards,
Sven
More information about the Lazarus
mailing list