[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A directory is a kind of file that contains other files entered under various names. Directories are a feature of the file system.
Emacs can list the names of the files in a directory as a Lisp list,
or display the names in a buffer using the ls
shell command. In
the latter case, it can optionally display information about each file,
depending on the options passed to the ls
command.
If full-name is non-nil
, the function returns the files'
absolute file names. Otherwise, it returns the names relative to
the specified directory.
If match-regexp is non-nil
, this function returns only
those file names that contain a match for that regular expression--the
other file names are excluded from the list.
If nosort is non-nil
, directory-files
does not sort
the list, so you get the file names in no particular order. Use this if
you want the utmost possible speed and don't care what order the files
are processed in. If the order of processing is visible to the user,
then the user will probably be happier if you do sort the names.
(directory-files "~lewis") => ("#foo#" "#foo.el#" "." ".." "dired-mods.el" "files.texi" "files.texi.~1~") |
An error is signaled if directory is not the name of a directory that can be read.
If pattern is written as an absolute file name, the values are absolute also.
If pattern is written as a relative file name, it is interpreted
relative to the current default directory. The file names returned are
normally also relative to the current default directory. However, if
full is non-nil
, they are absolute.
ls
according to
switches. It leaves point after the inserted text.
The argument file may be either a directory name or a file
specification including wildcard characters. If wildcard is
non-nil
, that means treat file as a file specification with
wildcards.
If full-directory-p is non-nil
, that means the directory
listing is expected to show the full contents of a directory. You
should specify t
when file is a directory and switches do
not contain `-d'. (The `-d' option to ls
says to
describe a directory itself as a file, rather than showing its
contents.)
On most systems, this function works by running a directory listing
program whose name is in the variable insert-directory-program
.
If wildcard is non-nil
, it also runs the shell specified by
shell-file-name
, to expand the wildcards.
MS-DOS and MS-Windows systems usually lack the standard Unix program
ls
, so this function emulates the standard Unix program ls
with Lisp code.
insert-directory
. It is ignored on systems
which generate the listing with Lisp code.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |