OS FileName$

From Br Wiki
Jump to: navigation, search

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)


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