.TH LSF 1csound CARL 
.SH NAME
lsf 
\- list sound files, sound file directories
.SH SYNOPSIS
.B lsf 
usage: lsf [flags] {[file]|[device]|[directory]} ... 
.nf
.RS .5i
 flags:
 -R	recursively search directories
 -l	print long format
 -f	print sound file descriptor
 -F	print sound file descriptor with cylinder block list
 -pX	print only files with substring X in filename
 -tX	sort files according to date
		X = c sort by creation date (default)
		X = a sort by date last altered
		X = r sort by date last referenced
 -C	sort files according to size in cylinders
 -r	reverse sort
 -a	print all files
 -0..-9 print all files on selected device that should be
	dumped at that level
.RE
.fi
.SH DESCRIPTION
.B lsf 
does for the 
.I csound 
file system what the regular UNIX 
.B ls
command does for the UNIX file system.  Without arguments, 
.B lsf
lists all the files in your current sound file directory. 
This is usually your home directory, although it can be changed
with 
.I cdsf(1csound).
If you specify a
list of sound files, it will print the names of those that exist.
If you specify a sound file directory, it will list
all the files in that directory and names of any subdirectories.  
If you specify a device, it will
recursively list all files and directories
in all directories on that device.
.PP
Filenames may be specified as a full path, as a partial path, or as
a name.  A full path specifies the device, and any directories leading
up to the name.  An example command to have 
.B lsf
verify that file 
.I test
in the current sound file directory
exists:
.RS .5i
% lsf test
.RE
A partial file name, checking file 
.I test 
in user frm's home sound file
directory:
.RS .5i
% lsf /frm/test
.RE
A partial file name, checking file
.I test
in a subdirectory
.I foo
of the current sound file directory:
.RS .5i
% lsf foo/test
.RE
A full filename, looking on device
.I /snda
for user frm's file
.I test:
.RS .5i
% lsf /snda/frm/test
.RE
In each of these cases, a single file is listed, if it exists.
Partial filenames may also designate directories, or devices.
When a filename names a directory, all files in that directory are
printed.
For instance, to print out all files in the directory of frm on device
.I /snd:
.RS .5i
% lsf /snd/frm
.RE
Equivalently, if your working directory is also
.I /snd, 
the command
.RS .5i
% lsf /frm
.RE
works identically.
On the other hand,
.RS .5i
% lsf frm
.RE
assumes that frm is either a sound file or a subdirectory
in your current sound file directory.  
The statement
.RS .5i
% lsf /snd
.RE
prints out all files recursively on that device.
.SH Flags
.IP -l
print long form.  Gives name, read/write status, 
protection, file type
.I (Scratch,
.I Hold,
or
.I Keep),
size of file in cylinders, whether it is contiguous or not, and the date.
Which date is printed depends on the 
.B -tX
flag.  Creation date is printed by default.
.IP -f
print the sound file descriptor.  Information includes sampling rate,
number of samples, channels, etc.
.IP -R
recursively search directories.  Turned on automatically when a
device is specified.
.IP -pX
print only files with substring X in filename.  This is 
a poor-man's version of "regular expressions".
Normal regular expressions don't work for 
.B lsf 
because the directory
searching is done by the shell, which looks in the UNIX file system
for obvious reasons, and knows nothing of the sound file system.
This mechanism gives a primitive searching capability.
The string X is taken as a key, and if the key is found in a filename,
.B lsf
prints it out.  The substring is applied only to actual filenames,
not directories.
.IP -tX
sort files according to date.  If there is a character X appended,
that will determine which date associated with the file will be used:
.RS 1i
.nf
X = c sort by creation date (default)
X = a sort by date last accessed
X = m sort by date last modified
.RE
.fi
.IP -C
sort files according to size in cylinders.
.IP -r
reverse sort.
.IP -a
print all files.  This prints out all files regardless of whether they
are SDF files or not.
.IP -0..-9
The flags, -0, -1, ... -9, provide the mechanism whereby one can manage
a system file dump program.  The algorithm is to return the names of
the files which have changed since the last lower level dump.
For information on how to manage a dump program, see
the manual page for dumpsf(1csound).
.SH AUTHOR
Gareth Loy
.SH SEE ALSO
dumpsf(1csound)
sndio(1csound), rmsf(1csound), mvsf(1csound), sfck(1csound).
