+
+
+DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 4, 0,
+ doc: /* Return a list of names of files in DIRECTORY.
+There are three optional arguments:
+If FULL is non-nil, return absolute file names. Otherwise return names
+ that are relative to the specified directory.
+If MATCH is non-nil, mention only file names that match the regexp MATCH.
+If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
+ NOSORT is useful if you plan to sort the result yourself. */)
+ (directory, full, match, nosort)
+ Lisp_Object directory, full, match, nosort;
+{
+ Lisp_Object handler;
+ directory = Fexpand_file_name (directory, Qnil);
+
+ /* If the file name has special constructs in it,
+ call the corresponding file handler. */
+ handler = Ffind_file_name_handler (directory, Qdirectory_files);
+ if (!NILP (handler))
+ return call5 (handler, Qdirectory_files, directory,
+ full, match, nosort);
+
+ return directory_files_internal (directory, full, match, nosort, 0, Qnil);
+}
+
+DEFUN ("directory-files-and-attributes", Fdirectory_files_and_attributes,
+ Sdirectory_files_and_attributes, 1, 5, 0,
+ doc: /* Return a list of names of files and their attributes in DIRECTORY.
+There are four optional arguments:
+If FULL is non-nil, return absolute file names. Otherwise return names
+ that are relative to the specified directory.
+If MATCH is non-nil, mention only file names that match the regexp MATCH.
+If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
+ NOSORT is useful if you plan to sort the result yourself.
+ID-FORMAT specifies the preferred format of attributes uid and gid, see
+`file-attributes' for further documentation. */)
+ (directory, full, match, nosort, id_format)
+ Lisp_Object directory, full, match, nosort, id_format;
+{
+ Lisp_Object handler;
+ directory = Fexpand_file_name (directory, Qnil);
+
+ /* If the file name has special constructs in it,
+ call the corresponding file handler. */
+ handler = Ffind_file_name_handler (directory, Qdirectory_files_and_attributes);
+ if (!NILP (handler))
+ return call6 (handler, Qdirectory_files_and_attributes,
+ directory, full, match, nosort, id_format);
+
+ return directory_files_internal (directory, full, match, nosort, 1, id_format);
+}
+