Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter SixFile Functions (continued)

PathToUNC Function

Overview

The PathToUNC function takes a string containing a path and converts it to a Universal Naming Convention (UNC) string.

Syntax/Parameters

Syntax

string = PathToUNC ( string path );

Parameters

path

A string containing a source path, which must be located on a network. The path value generally references a drive via a mapped network resource.

Return Value

Returns a string containing the UNC version of the path or an empty string on failure. Use the GetLastError function to retrieve error information.

Remarks

UNC designations provide a universal form of referring to network resources identifiers in an unambiguous, computer-independent manner. The UNC can be passed to processes on other computers, allowing those processes to obtain access to the resource.

The PathToUNC function supports universal name in the following way:

\\servername\sharename\path\file

Using the example from the preceding description of the path parameter, if the shared network drive is on a server named COOLSERVER, and the share name is HOTSHARE, the UNC name for the network resource whose drive-based name is “H:\Win32\Examples\Sample.doc” would be the following:

\\coolserver\hotshare\win32\examples\sample.doc

If a non-network (local drive) is used as the target path, the function will return an empty string with an error retrievable with GetLastError.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic