Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -fs- package available from SSC


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: -fs- package available from SSC
Date   Mon, 10 May 2004 17:52:04 +0100

Thanks to Kit Baum, a new package -fs- has been posted on 
SSC containing a single small utility, also called -fs-. 

-fs- is to show names of files in compact form. The 
name is chosen with the hope of reminding you of 
the -ds- command, whose mission in life is showing 
names of variables in compact form. 

Your reaction to this may well be "What! Surely, 
this is already done by -dir- and -ls-?" 

Yes indeed, but -fs- may be worth your attention 
for some specific details. 

First, it tries very hard to be compact. Depending 
on your typical filename lengths, the output 
should be a fair bit more compact than even (say) 
-dir, wide-. Of course, this is done by leaving 
out information, but if all you want is names, you
shouldn't mind. 

Second, the syntax is 

    fs [filespec [filespec [ ... ]]]

while the optional file specifications indicate filenames 
or (more commonly) sets of filenames using wildcards * or ?. 
Thus unlike -dir- or -ls-, -fs- may be given more than one 
file specification. This is possibly useful when you want 
to do something like 

. fs *.dta *.do 

Also unlike either of those commands, -fs- shows any hidden 
files. This might be considered a misfeature.... 

Third, although it is not documented in the help file, 
programmers and others might like to note that the 
list of files is also returned as `r(files)'. 
Naturally, if this is the kind of thing that interests
you, you will already know about the extended function 
documented at -help macro-. 

Fourth, -fs- is an advertisement for a very nice subroutine 
for display in columns, already used within -classutil-
and -ds-. Programmers may want to take a look. In fact, 
most of the code is stolen from -classutil-. 

Nick 
[email protected] 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index