_splitpath

Splits a full path name into four components consisting of a server/volume name, directory path, file name, and file name extension

Local Servers:blocking
Remote Servers:N/A
Platform:NLM
Service:File System

Syntax

   #include <nwfileio.h>  
    
   void _splitpath  (  
      const char  *path,   
      char        *drive,   
      char        *dir, 
      char        *fname,   
      char        *ext);
   

Parameters

path

(IN) Specifies the string containing the full path name to split.

drive

(OUT) Points to the server/volume name or drive letter. The maximum string length is 64.

dir

(OUT) Points to the directory path. The maximum string length is 254.

fname

(OUT) Points to the base name of the file without an extension. The maximum string length is 8.

ext

(OUT) Points to the file name extension, including the leading period. The maximum string length is 4.

Remarks

_splitpath returns the drive letter in the drive parameter. If you pass it a NetWare path, _splitpath returns the NetWare server/volume in the drive parameter.

This function is coded to work only with the DOS namespace (8.3).

The drive, dir, fname, and ext parameters are not filled in if they are NULL. For each component of the full path name that is not present, its corresponding buffer is set to an empty string.

See Using _makepath and _splitpath: Example (NDK: Sample Code).

See Also

_makepath