Title

file/directory path - el version

Description

path_el is a somewhat more flexible version of a standard file- or directory- path. It does not require quotes, even if it includes spaces, and it allows the standard wildcard characters:

* for any string of 0 or more characters

? for any single character

Enough information must be included for each directory to resolve unambigously to a single, existing, directory. Any part of the path_el that could refer to more than one directory will cause an error.

The same thing is usually true for files; however, there are some commands that allow wildcards to specify multiple files in a directory.

[+] One thing to watch out for: Stata interprets /* as the beginning of a comment, so it will not recognize it as part of a path_el. The simplest solution (on a windows machine) is to use \* instead.

Examples

Given a directory with subdirectories:

able
baker
charlie
delta

the path_el c* would be interpreted as charlie. If the subdirectories were:

able
baker
charlie
chan
delta

the path_el c* would result in an error message listing both charlie and chan.

Given a file: top/next/third/thefile.dta

The path_el t*/n*/th*/t* would successfully refence it - assuming that the abbreviations at each level could be resolved without ambiguity.