GetPathComponents

Demonstrates how to extract all the path components from a full path name.

Remarks

This example extracts a list of directory names from the path of a filename.

Code

 local int i, mstring path_list
 local string file

 file = GetPCIHOME() + "/demo/irvine.pix"

 print "Basename:", GetFileBasename( file ) 
 print "Extension:", GetFileExtension( file )
 
 path_list = GetPathComponents( file )
 for i = 1 to f$len(path_list)
    print "Path Component:", path_list[i]
 endfor

Output

Basename: irvine
Extension: pix
Path Component:C:
Path Component:CATALYST Professional
Path Component:demo

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.