Returns the number of components contained in a NetWare® pathname
#include <nwfileio.h>
int CountComponents (
BYTE *pathString,
int len);
(IN) Points to the string containing the NetWare pathname.
(IN) Specifies the length (in bytes) of the pathString.
This function returns the number of components in pathString.
This function works only with NetWare path names, which can consist of a directory path, file name, and file name extension.
A NetWare path consists of a path string and a path count. The path string does not use any type of delimiter character between components of the path. Instead, the length of each path component is specified in the byte immediately preceding each component of the path string. The path count tells how many path components there are in a path. This is the number returned by CountComponents.
For example, a normal path might look like this:
serverName/vol2:first/second/third/file.dat
If serverName is assigned file server ID 1, and vol2 is assigned volume number 2, then the corresponding NetWare path format would be:
fileServerID = 1 volumeNumber = 2 pathString = 5first6second5third8file.dat pathCount = 4
The fileServerID and volumeNumber are not actually part of the pathString, but are kept as separate numeric values. The numbers that are part of the pathString are actual binary values, not their ASCII equivalents. The pathString is the entity that would be passed to CountComponents (with a length of 28, which is the total length of pathString), and the returned component count would be 4 (the number of component parts in pathString).