help mata adosubdir()
-------------------------------------------------------------------------------
Title
[M-5] adosubdir() -- Determine ado-subdirectory for file
Syntax
string scalar adosubdir(string scalar filename)
Description
adosubdir(filename) returns the subdirectory in which Stata would search
for filename. Typically the subdirectory name will be simply the first
letter of filename. However, certain files may result in a different
subdirectory, depending on their extension.
Remarks
adosubdir("xyz.ado") returns "x" because Stata ado-files are located in
subdirectories with name given by their first letter.
adosubdir("xyz.style") returns "style" because Stata style files are
located in subdirectories named style.
Conformability
adosubdir(filename):
filename: 1 x 1
result: 1 x 1
Diagnostics
adosubdir() returns the first letter of the filename if the filetype is
unknown to Stata, thus treating unknown filetypes as if they were
ado-files.
adosubdir() aborts with error if the filename is too long for the
operating system; nothing else causes abort with error.
Source code
Function is built in.
Also see
Manual: [M-5] adosubdir()
Help: [M-4] io