• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
      • Io
      • Defttag
      • Sys-call
      • Save-exec
      • Quicklisp
      • Oslib
        • File-types
        • Argv
        • Copy
        • Catpath
        • Universal-time
        • Ls
        • Basename
        • Tempfile
        • Dirname
        • Copy!
        • Mkdir
        • Ls-files
        • Lisp-version
        • Rmtree
        • Ls-subdirs
          • Lisp-type
          • Date
          • Getpid
          • Basenames
          • Dirnames
          • Ls-subdirs!
          • Ls-files!
          • Dirname!
          • Basename!
          • Catpaths
          • Mkdir!
          • Ls!
          • Rmtree!
          • Remove-nonstrings
        • Std/io
        • Bridge
        • Clex
        • Tshell
        • Unsound-eval
        • Hacker
        • Startup-banner
        • Command-line
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Oslib

    Ls-subdirs

    Get a listing of the subdirectories of a directory.

    Signature
    (ls-subdirs path &key (state 'state)) 
      → 
    (mv error subdirs state)
    Arguments
    path — Directory whose subdirectories you want to list.
        Guard (stringp path).
    Returns
    error — NIL on success or an error msg on failure.
    subdirs — On success: a list of the subdirectories of path.
        Type (string-listp subdirs).
    state — Type (state-p1 state), given (force (state-p1 state)).

    The notion of regular file is governed by directory-p. It includes, for instance, symbolic links to directories.

    Definitions and Theorems

    Function: ls-subdirs-fn

    (defun ls-subdirs-fn (path state)
           (declare (xargs :stobjs (state)))
           (declare (xargs :guard (stringp path)))
           (let ((__function__ 'ls-subdirs))
                (declare (ignorable __function__))
                (b* (((mv err all-files state) (ls path))
                     ((when err) (mv err nil state)))
                    (ls-subdirs-aux path all-files state))))

    Theorem: string-listp-of-ls-subdirs.subdirs

    (defthm string-listp-of-ls-subdirs.subdirs
            (b* (((mv common-lisp::?error
                      ?subdirs acl2::?state)
                  (ls-subdirs-fn path state)))
                (string-listp subdirs))
            :rule-classes :rewrite)

    Theorem: state-p1-of-ls-subdirs.state

    (defthm state-p1-of-ls-subdirs.state
            (implies (force (state-p1 state))
                     (b* (((mv common-lisp::?error
                               ?subdirs acl2::?state)
                           (ls-subdirs-fn path state)))
                         (state-p1 state)))
            :rule-classes :rewrite)