NWParsePath

Parses a path string

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.11, 3.12, 3.2, 4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Path and Drive

Syntax

   #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);
   

Delphi Syntax

   uses calwin32 
    
   Function NWParsePath 
     (const path : pnstr8; 
      serverName : pnstr8; 
      Var conn : NWCONN_HANDLE; 
      volName : pnstr8; 
      dirPath : pnstr8 
   ) : NWCCODE;
   

Parameters

path

(IN) Points to the path to be parsed.

serverName

(OUT) Points to the server name (48 characters, optional).

conn

(OUT) Points to the connection handle of the server (optional).

volName

(OUT) Points to the volume name (17 characters, optional).

dirPath

(OUT) Points to the directory portion of the path; this parameter should be a buffer of at least 256 characters.

Return Values

These are common return values; see Return Values (Return Values for C) for more information.

0x0000

SUCCESSFUL

0x880F

NO_CONNECTION_TO_SERVER

Remarks

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:

Specification

Function

drive:path

Drive letter is used to determine the network information, if any.

vol:path

Volume and path will be assumed to be relative to the default server.

server vol:path

Information is copied to the associated return buffers and, if requested, the connection handle is obtained using the server name.

path

Current drive is used to determine all the information.

If a map rooted drive is used, dirPath will be set to the complete directory path from the volume level.

NCP Calls

See Also

NWParseNetWarePath