Split path name

Command groupFlag affectedReversibleExecute on clientPlatform(s)
External commandsYESNONOWindows,Linux

Syntax

Split path name
 
(path, drive-name, directory-name, file-name, file-extension)
 
Returns 
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 (values are listed at the end of this Appendix), or zero if no error occurs. The following examples show how Split path name operates.

Windows

Path Drive Directory Filename Extension
C:\TESTDIR\TESTSDIR\TESTFILE C: \TESTDIR\TESTSDIR\ TESTFILE
C:\TESTDIR\TESTFILE.EXT C: \TESTDIR\ TESTFILE .EXT
C:\TESTFILE C: \ TESTFILE

Linux

Path Drive Directory Filename 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'

Split path name
 
(
lPathname
,
lDrive
,
lDirectory
,
#
???,
lExtension
)

 
# lDrive= 'c:'

# lDirectory = '\desktop\myfolder\'

# lFileName = 'mylibrary'

# lExtension ='.lbs'