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