Parses a path string
#include <nwdpath.h>
or
#include <nwcalls.h>
N_EXTERN_LIBRARY(NWCCODE) NWParsePath (
constr nstr8 N_FAR *path,
pnstr8 serverName,
NWCONN_HANDLE N_FAR *conn,
pnstr8 volName,
pnstr8 dirPath);
uses calwin32
Function NWParsePath
(const path : pnstr8;
serverName : pnstr8;
Var conn : NWCONN_HANDLE;
volName : pnstr8;
dirPath : pnstr8
) : NWCCODE;
(IN) Points to the path to be parsed.
(OUT) Points to the server name (48 characters, optional).
(OUT) Points to the connection handle of the server (optional).
(OUT) Points to the volume name (17 characters, optional).
(OUT) Points to the directory portion of the path; this parameter should be a buffer of at least 256 characters.
These are common return values; see Return Values (Return Values for C) for more information.
If conn is not NULL, a new connection handle will be returned by NWParsePath. You will need to ensure this connection handle is properly closed.
If the path to be parsed is relative to the current directory, NWParsePath assumes the current drive and path so a complete path specification is returned.
IF k: is the current drive AND \dir1 is the current directory on k: AND dir2 is a directory in dir1 THEN calling NWParsePath with path pointing to "dir2" will cause dirPath to return "dir1\dir2".
If the path to be parsed contains a map rooted drive, dirPath will be set to the complete directory path from the volume level.
IF k:is map rooted to server1/sys:dir1\ AND dir2 is a directory in dir1 THEN calling NWParsePath with path pointing to "k:dir2" will cause dirPath to return "dir1\dir2" even though the DOS path is k:\dir2.
If the path to be parsed is relative to the current directory, the entire directory path will be returned, without a preceding `\’ character.
IF k: is mapped to server1/sys: AND the current directory path for k: is dir1 AND dir2 is a directory in dir1 THEN calling NWParsePath with path pointing to "k:dir2" will cause dirPath to return "dir1\dir2".
If the path to be parsed is on the root directory, dirPath will return with a preceding `\’ character even if one is not included in the call. This is the only case that will return a preceding `\’ character.
IF k: is mapped to server1/sys: AND the current directory path on k: is the root AND dir1 is a directory on the root THEN calling NWParsePath with path pointing to "k:dir1" will cause dirPath to return "\dir1". Note the preceding `\’ character in this case. This is the same for local drives and mapped drives.
serverName, conn, volName, and dirPath are optional. Substitute NULL if no returns are desired. However, all parameter positions must be filled.
If the path is on a local drive, return information is placed in the return parameters as follows:
serverName zero-length string conn 0 volName drive letter dirPath directories from drive letter
NWParsePath does not guarantee the path actually exists.
If the path specifies a NetWare server name and there are no connections to that NetWare server, NO_CONNECTION_TO_SERVER is returned. The path specification can be any of the following:
If a map rooted drive is used, dirPath will be set to the complete directory path from the volume level.