Function: find-cmd

find-cmd is an autoloaded and byte-compiled function defined in find-cmd.el.gz.

Signature

(find-cmd &rest SUBFINDS)

Documentation

Initiate the building of a find command.

For example:

(find-cmd '(prune (name ".svn" ".git" ".CVS"))
          '(and (or (name "*.pl" "*.pm" "*.t")
                    (mtime "+1"))
                (fstype "nfs" "ufs"))))

default-directory is used as the initial search path. The result is a string that should be ready for the command line.

Probably introduced at or before Emacs version 23.1.

Source Code

;; Defined in /usr/src/emacs/lisp/find-cmd.el.gz
;;;###autoload
(defun find-cmd (&rest subfinds)
  "Initiate the building of a find command.
For example:

\(find-cmd \\='(prune (name \".svn\" \".git\" \".CVS\"))
          \\='(and (or (name \"*.pl\" \"*.pm\" \"*.t\")
                    (mtime \"+1\"))
                (fstype \"nfs\" \"ufs\"))))

`default-directory' is used as the initial search path.  The
result is a string that should be ready for the command line."
  ;; FIXME: Provide a version that returns a list of strings (ready to pass to
  ;; call-process).
  (concat find-program " "
          (shell-quote-argument (expand-file-name default-directory)) " "
          (cond
           ((cdr subfinds)
            (mapconcat #'find-to-string subfinds ""))
           (t
            (find-to-string (car subfinds))))))