FileOps.$splitpathname()

Function groupExecute on clientPlatform(s)
FileOpsNOAll

Syntax

FileOps.$splitpathname(cPath,&cDriveName[,&cDirectoryName,&cFileName,&cFileExtension])

Description

Splits the path cPath into cDriveName, cDirectoryName, cFileName, and cFileExtension. Returns zero for success or a non-zero error code

The function returns an error code, or zero if successful: see the FileOps function error codes.

Example

Do
 
sys(
(10)
 
Returns 
lPath

# returns the name and path of current library

 
Do
 
FileOps
.
$splitpathname
(
lPath
,
lDrive
,
lDirName
,
lFilename
,
lFileExtn
)
 
Returns 
lError

# under Windows, when lPath = 'C:\OMNIS\EXAMPLES\EXTCOMP.LBS'

# lDrive     returns     C:

# lDirName   returns     \OMNIS\EXAMPLES\

# lFileName  returns     EXTCOMP

# lFileExtn  returns     .LBS

 
Do
 
FileOps
.
$splitpathname
(
'c:\omnis'
,
lDrive
,
lDirName
,
lFilename
,
lFileExtn
)
 
Returns 
lError

# under Windows

# lDrive     returns     C:

# lDirName   returns     \

# lFileName  returns     OMNIS

# lFileExtn  returns     (empty)

 
Do
 
FileOps
.
$splitpathname
(
'HD:Omnis:Examples:Extcomp.lbs'
,
lDrive
,
lDirName
,
lFilename
,
lFileExtn
)
 
Returns 
lError

# under Mac OSX

# lDrive     returns     HD

# lDirName   returns     :Omnis:Examples:

# lFileName  returns     Extcomp

# lFileExtn  returns     .lbs

 
Do
 
FileOps
.
$splitpathname
(
'/omnis/examples/extcomp.lbs'
,
lDrive
,
lDirName
,
lFilename
,
lFileExtn
)
 
Returns 
lError

# under Linux

# lDrive     returns     (empty)

# lDirName   returns     /omnis/examples

# lFileName  returns     extcomp

# lFileExtn  returns     .lbs