OS FileName$: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 22: Line 22:


<noinclude>
<noinclude>
[[Category:Commands]]
[[Category:Internal Functions]]
[[Category:Internal Functions]]
[[Category:Release 4.18]]
</noinclude>
</noinclude>

Revision as of 09:26, 30 January 2012

The OS_FileName$(A$) internal function does returns the real operating system path of a virtual path. In other words it converts a BR filename A$ based on a Drive statement to the name used by the operating system outside of BR. This internal function does the opposite of BR_FileName$.

In BR a file name that is preceded with a colon (":") (i.e. ":C:\Test") is always interpreted as an operating system file path and/or name. File specifications without a preceding colon will be processed as a BR file path and/or name (a.k.a. Virtual Path)


Syntax

OS_FileName$(A$)
OS_FileName$("C:\Example Path\")

Comments and examples

When a DRIVE statement included in the BRCONFIG.SYS file, or executed with EXECUTE CONFIG DRIVE which remaps a location within BR, a system call that refers to a file on the remapped drive will fail unless the remapping parallels the operating system location. Using the OS_FILENAME$(A$) in the system call rather than just the BR name will allow the operating system to find the correct file.

01010 EXECUTE "CONFIG DRIVE X:,\\server1\data\datafiles,\,\"
01020 EXECUTE "SYS COPY "&OS_FILENAME$(X:\tempfile)&" "&OS_FILENAME$(X:\tempfile)&".tmp"

Related functions