NWSMFixGenericDirectoryPath (Obsolete)

Formats a fully qualified parent directory path according to the specified NetWare name space specifications in both Byte and Unicode formats. Call NWSMTSFixDataSetName instead.

Syntax

  #include <smsutapi.h> 
   
  STRING NWSMFixGenericDirectoryPath ( 
     void              *path, 
     UINT32             nameSpaceType, 
     GENERIC_BUFFER **newPath, 
     NWBOOLEAN          wildAllowedOnTerminal);
  

Parameters

path

(IN/OUT) Points to the NetWare path to be formatted in Byte or Unicode format.

nameSpaceType

(IN) Specifies the name space type of name (see nameSpaceType Values).

newPath

(OUT) Points to the buffer to contain the formatted directory path.

wildAllowedOnTerminal

(IN) Specifies if the path contains wildcard in the last path node:

  • TRUE Last node contains wildcards
  • FALSE Last node does not contain wildcards

Return Values

The following table lists the return values associated with the function.

NULL

Error

Nonzero

A pointer to the fixed up path in path or newPath.string.

Remarks

NWSMFixGenericDirectoryPath ensures that path has a primary separator and the proper case. If path does not contain a primary separator ( : or  :: ), it returns NULL.

Volume names on NetWare and DOS paths are always converted to upper case.

If wildAllowedOnTerminal is set and the path nodes (other than the terminal node) contain wildcards, NWSMFixGenericDirectoryPath returns NULL.

NWSMFixGenericDirectoryPath adds an end separator to the terminal path node if the terminal path node is a parent. If an ending separator is added to the string, newPath will contain the formatted string.

The following statement determines where the formatted path will be returned:

  if (newPath && newpath->string) 
     /* newPath contains the fixed up path. */ 
  else 
     /* path contains the fixed up path. */
  

Usually, path and nameSpaceType are determined from NWSM_DATA_SET_NAME_LIST.

The following fixes are applied to path for the specified name space (except Macintosh):

  • All backslashes ( \ ) are converted to forward slashes ( / ).

  • For all colon and slash combinations ( :\ or  :/ ), the slash is removed and all characters after the slash are moved one space toward the colon.

If newPath is NULL, NWSMFixGenericDirectoryPath allocates the needed buffer space.

Call NWSMFreeString to free the buffer memory.

If the name space requires it, a separator must follow a parent terminal node.

NWSMFixGenericDirectoryPath Example

  unsigned char *p = “Vol1:\system\temp”, *ptr; 
  STRING path = p; 
  UINT32 nameSpaceType = DOSNameSpace; 
  STRING_BUFFER *newPath = NULL; 
   
  ptr = NWSMFixDirectoryPath(path, nameSpaceType, &newPath, FALSE); 
   
  if (newPath && newPath->string) 
  { 
     /* newPath contains the fixed up path. */ 
  } 
   
  else 
     /* path contains the fixed up path. */