mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 16:19:13 +02:00
Docs: LazUtils/lazfileutils. Updates the ReadaAllLinks topic for changes in 5864b598
, 1ba49f19
. Issue #40689.
* Implements ReadAllLinks for the Windows platform.
This commit is contained in:
parent
8985e4ed16
commit
fbddbee171
@ -2916,18 +2916,44 @@ Resolves a symbolic link to an actual file name.
|
|||||||
<descr>
|
<descr>
|
||||||
<p>
|
<p>
|
||||||
<var>ReadAllLinks</var> is a <var>String</var> function used to resolve a
|
<var>ReadAllLinks</var> is a <var>String</var> function used to resolve a
|
||||||
symbolic link to an actual file name. It does not resolve symbolic links in
|
symbolic link to an actual file name. The implementation is platform-specific.
|
||||||
parent (or ancestor) directories.
|
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If a symlink cannot be resolved, and ExceptionOnError is <b>False</b>, the
|
For UNIX-like platforms, fpReadLink (RTL) is used to recursively follow
|
||||||
function returns an empty string (''). If ExceptionOnError is <b>True</b>, it
|
symbolic links starting at FileName (to a maximum depth of 12) until it is
|
||||||
raises an EFOpenError with a message containing more details. For the Windows
|
resolved to a path on the local file system. No actions are performed in the
|
||||||
platform, it simply returns the value in the Filename argument.
|
routine if FileName is a regular file and not a symbolic link.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The return value contains the resolved path to the file on the local file
|
||||||
|
system. This includes calling ResolveDots for a file name with a relative path.
|
||||||
|
If the return value is empty when an error is detected, the error message is
|
||||||
|
captured and used in an EFOpenError exception raised when ExceptionOnError is
|
||||||
|
enabled. If ExceptionOnError is <b>False</b>, the function returns an empty
|
||||||
|
string ('') for an invalid link.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
For the Windows platform, FileGetSymLinkTarget (RTL) is recursively called (to
|
||||||
|
a maximum depth of 20) to get the reparse point with the target file name. The
|
||||||
|
return value contains the UTF-8-encoded path to the file on the local file
|
||||||
|
system, or an empty string if FileName is not a valid symbolic link.
|
||||||
|
ExceptionOnError indicates whether an EFOpenError exception is raised for an
|
||||||
|
invalid link in FileName. If ExceptionOnError is <b>False</b>, the function
|
||||||
|
returns an empty string ('') and the exception is <b>not</b> raised for an
|
||||||
|
invalid link.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
For the Amiga platform, the return value is always an empty string ('').
|
||||||
</p>
|
</p>
|
||||||
</descr>
|
</descr>
|
||||||
|
<version>
|
||||||
|
Modified in LazUtils version 3.6 to implement the routine on the Windows
|
||||||
|
platform.
|
||||||
|
</version>
|
||||||
</element>
|
</element>
|
||||||
<element name="ReadAllLinks.Result">
|
<element name="ReadAllLinks.Result">
|
||||||
|
<element name="#rtl.sysutils.FileGetSymLinkTarget">FileGetSymLinkTarget (RTL)</element>
|
||||||
|
<link id="#rtl.baseunix.fpReadLink">fpReadLnk (RTL)</link>
|
||||||
<short>
|
<short>
|
||||||
Resolved path to the specified file name, or an exception message when
|
Resolved path to the specified file name, or an exception message when
|
||||||
link(s) could not be resolved.
|
link(s) could not be resolved.
|
||||||
@ -2938,14 +2964,14 @@ link(s) could not be resolved.
|
|||||||
</element>
|
</element>
|
||||||
<element name="ReadAllLinks.ExceptionOnError">
|
<element name="ReadAllLinks.ExceptionOnError">
|
||||||
<short>
|
<short>
|
||||||
<b>True</b> to raise an exception for unresolved links. <b>False</b> to
|
<b>True</b> to raise an exception for unresolved or broken links. <b>False</b>
|
||||||
handle the exception internally and return the error message.
|
to handle the error internally without raising an exception.
|
||||||
</short>
|
</short>
|
||||||
</element>
|
</element>
|
||||||
|
|
||||||
<element name="TryReadAllLinks">
|
<element name="TryReadAllLinks">
|
||||||
<short>
|
<short>
|
||||||
Resolves a symlink to the real file.
|
Resolves a symlink to a real file name.
|
||||||
</short>
|
</short>
|
||||||
<descr>
|
<descr>
|
||||||
<p>
|
<p>
|
||||||
@ -2953,6 +2979,9 @@ If a symlink can not be resolved it returns Filename. It calls the
|
|||||||
ReadAllLinks function in its implementation.
|
ReadAllLinks function in its implementation.
|
||||||
</p>
|
</p>
|
||||||
</descr>
|
</descr>
|
||||||
|
<seealso>
|
||||||
|
<link id="ReadAllLinks"/>
|
||||||
|
</seealso>
|
||||||
</element>
|
</element>
|
||||||
|
|
||||||
<element name="GetShellLinkTarget">
|
<element name="GetShellLinkTarget">
|
||||||
|
Loading…
Reference in New Issue
Block a user