Formats a fully qualified parent directory path according to the specified name space specifications.
#include <smstsapi.h> CCODE NWSMTSFixDataSetName ( UINT32 connection, STRING dataSetName, UINT32 nameSpaceType, NWBOOLEAN isParent, NWBOOLEAN wildAllowedOnTerminal, STRING_BUFFER **newDataSetName);
(IN) Specifies the connection information returned by NWSMConnectToTSA.
(IN/OUT) Specifies the path to be fixed.
(IN) Specifies the name space type of dataSetName. (see nameSpaceType Values)
(IN) Specifies the type of path contained in dataSetName:
(IN) Specifies if the path contains wild cards only in the terminal path node:
(OUT) Points to the buffer to receive the fixed up path.
See Section 9.3, Target Service Return Values for more information.
The following table lists the return values associated with the function.
If dataSetName contains a fully qualified path, NWSMTSFixDataSetName ensures that the path has a separator and proper case. NWSMTSFixDataSetName also adds a separator to the terminal path node if isParent is set to TRUE. If the nameSpaceType defines a first separator and the path does not contain a valid separator, NWSMTSFixDataSetName returns NWSMTS_INVALID_PATH.
The fixed up path is returned in newDataSetName. NWSMTSFixDataSetName copies dataSetName to newDataSetName and performs the following fix ups and checks on the path:
Converts the appropriate path nodes to upper case as follows:
DOS paths are converted to upper case
All primary resources before first separator (if supported by the nameSpaceType on the target service) in NFS, FTAM, and OS/2 are converted to upper case.
For all non-Macintosh paths the following fixes and checks are performed:
All backslashes (\) are converted to forward slashes (/), except for NFSNamespace.
Ensures only the terminal path node contains wild cards.
If isParent is set to TRUE and dataSetName does not end with first separator (if supported by the nameSpaceType on the target service), backslash (\), or forwardslash (/), a forwardslash (/) is added to the end of the path.
If the path contains “:/” or :\,” the slash is removed from the path, if the first separator for the nameSpaceType is a “ : ”.
For all Macintosh paths the following checks and fixes are performed:
If isParent is TRUE and dataSetName does not end with a colon, a colon is added to the end of the path.
If isParent is TRUE, dataSetName is checked to ensure it contains a colon or double colon.
The values that can be set for nameSpaceType is listed in the following table.
The following table lists the wild cards options that can be used in the terminal path node.
If NWSMTSFixDataSetName encounters an error as it tries to fix the path, a NULL string is returned in newDataSetName.
NWSMTS_INVALID_PATH is returned if dataSetname meets one or more of the following conditions:
dataSetName is a parent and does not contain valid first separator, if the nameSpaceType supports a first separator on the target service..
Non-Macintosh path nodes, other than the terminal path node, contain wild cards.
wildAllowedOnTerminal is set to FALSE and non-Macintosh paths contain wild cards.
The path is improperly formatted.
The engine is responsible for freeing the memory held by newDataSetName. To free this buffer, call NWSMFreeString. (See Storage Management Services Utility Library).
NOTE:NWSMTSFixDataSetName will eventually replace the utility function NWSMFixDirectoryPath (see Storage Management Services Utility Library).