*! version 1.1.0 16feb2023

Title

splitpath -- Split a path to a file into the directory and the filename.

Syntax

splitpath
path

Description

splitpath splits the path to a file into the directory containing the file
and the filename. Relative directories are supported. The results are store in
r(directory) and r(filename) respectively.

Examples

. splitpath "sub\dir\example.do"
. return list

macros:
r(filename) : "example.do"
r(directory) : "sub/dir/"

. splitpath "..\dir\example.do"
. return list

macros:
r(filename) : "example.do"
r(directory) : "../dir/"

Author

Hendri Adriaens, Centerdata, The Netherlands.

hendri.adriaens@centerdata.nl

Acknowledgement

The package borrowed code from the function project_pathname from the project package.