Split path name

20% Command group 20% Flag affected 20% Reversible 20% Execute on client 20% Platform(s)
External commands YES NO NO Windows,Linux

Syntax

Split path name (pathdrive-namedirectory-namefile-namefile-extensionReturns err-code

Description

Note: The flag is set according to whether Omnis was able to make a call to this external command.

This command splits a full path name into its component parts: the drive name, directory and file name, and file extension. It returns an error code (See Error Codes), or zero if no error occurs. The following examples show how Split path name operates.

Windows

20% Path 10% Drive 20% Directory 10% Filename 40% Extension
C:\TESTDIR\TESTSDIR\TESTFILE C: \TESTDIR\TESTSDIR\ TESTFILE
C:\TESTDIR\TESTFILE.EXT C: \TESTDIR\ TESTFILE .EXT
C:\TESTFILE C: \ TESTFILE

Linux

20% Path 10% Drive 20% Directory 10% Filename 40% Extension
/TESTDIR/TESTSDIR/TESTFILE /TESTDIR/TESTSDIR/ TESTFILE
/TESTDIR/TESTFILE.EXT /TESTDIR TESTFILE .EXT
/TESTFILE / TESTFILE

Example

# split the path name lPathname
Calculate lPathname as 'c:\desktop\myfolder\mylibrary.lbs' ## Windows example using '\'
Split path name (lPathname,lDrive,lDirectory,lFileName,lExtension) 
# lDrive= 'c:'
# lDirectory = '\desktop\myfolder\'
# lFileName = 'mylibrary'
# lExtension ='.lbs'