File.RealPath (gb)
Static Function RealPath ( Path As String [ , Parent As Boolean ] ) As String
Since 3.13
Return the canonical absolute pathname of a path, with no symbolic links inside.
Since 3.20
If the optional
Parent argument is
TRUE
, and if
Path is a relative path received from another component (usually by a function argument),
then the returned path will be modified so that it points at the same file.
For example, if
Path is
./image.png
, then
File.Path("./image.png", True)
will return
../image.png
, so that the new path points at the same file as the old path from a calling component.
This function is useful when a public API of a component receives a file path from a call located in another component, usually the main project.
Example
[gb.markdown].Markup.ProcessCode.1104: Cannot load component 'gb.highlight': cannot find component
You must sure that the path comes from another component before using this feature, and you must call it once.
For example, you can't call
Response.SendFile()
from the same component (i.e. from
gb.web
source code) with a local path, because
then it will search for that file in the parent component, not in the
gb.web
component.