SPLITPATHQQ

Run-Time Function: Breaks a file path or directory path into its components.

Module: USE DFLIB

Syntax

result = SPLITPATHQQ (path, drive, dir, name, ext)

path
(Input) Character*(*). Path to be broken into components. Forward slashes (/), backslashes (\), or both can be present in path.


drive
(Output) Character*(*). Drive letter followed by a colon.


dir
(Output) Character*(*). Path of directories, including the trailing slash.


name
(Output) Character*(*). Name of file or, if no file is specified in path, name of the lowest directory. If a filename, does not include an extension.


ext
(Output) Character*(*). Filename extension, if any, including the leading period (.).

Results:

The result is of type INTEGER(4). The result is the length of dir.

The path parameter can be a complete or partial file specification.

$MAXPATH is a symbolic constant defined in module DFLIB.F90 (in the \DF98\INCLUDE subdirectory) as 260.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: FULLPATHQQ

Example

 USE DFLIB
 CHARACTER($MAXPATH) buf
 CHARACTER(3)        drive
 CHARACTER(256)      dir
 CHARACTER(256)      name
 CHARACTER(256)      ext
 CHARACTER(256)      file

 INTEGER(4)          length

 buf = 'b:\fortran\test\runtime\tsplit.for'
 length = SPLITPATHQQ(buf, drive, dir, name, ext)
 WRITE(*,*) drive, dir, name, ext
 file = 'partial.f90'
 length = SPLITPATHQQ(file, drive, dir, name, ext)
 WRITE(*,*) drive, dir, name, ext

 END