{smcl} {* 20oct2005}{...} {cmd:help getfilename2} {hline} {title:Title} {p 4 22 2} {cmd:getfilename2} {hline 2} Improved Utility for handling filename specifications {title:Syntax} {p 8 8 2}{cmd:getfilename2} {cmd:`"}{it:path-filename}{cmd:"'} {title:Description} {pstd}{cmd:getfilename2} adds a few new features to the {helpb _getfilename} command. In addition to returning the filename in {cmd:r(filename)}, it also returns the path in {cmd:r(path)}, the root (filename without the extension) in {cmd:r(root)}, and the extension in {cmd:r(ext)}. {title:Example} {phang}{cmd:. getfilename2 c:\Program Files\Stata9\ado\base\a\auto.dta}{break} {txt:r(filename):} {res:auto.dta}{break} {txt:r(path):} {res:c:\Program Files\Stata9\ado\base\a}{break} {txt:r(root):} {res:auto}{break} {txt:r(ext):} {res:dta}{break} {title:Author} {p 4 4 2}Jeffrey Arnold {p_end} {p 4 4 2}Payments Studies Function, Federal Reserve Bank of New York {p_end} {p 4 4 2}{browse "mailto:jeffrey.arnold@ny.frb.org":jeffrey.arnold@ny.frb.org} {title:Also see} {psee} Online: {helpb _getfilename}, {helpb dir}, {helpb findfile}, {helpb macro}, {helpb sysdir} {p_end}