• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
        • Bitcoin
        • Zcash
        • Yul
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
          • Read-file-into-byte-array-stobj
          • Read-file-into-character-array-stobj
          • Read-objects-from-book
          • Write-strings-to-file!
          • Write-strings-to-file
          • Write-objects-to-file!
          • Write-bytes-to-file!
          • Write-objects-to-file
          • Read-objects-from-file
          • Read-object-from-file
          • Read-file-into-byte-list
          • Write-strings-to-channel
          • Write-bytes-to-file
          • Write-bytes-to-channel
          • Read-file-into-character-list
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Io
    • File-io-light

    Read-file-into-character-list

    Read a file into a character-list.

    ;; Returns a character list, or nil if the file does not exist.
    ;; May be faster than read-file-characters from std/io.
    ;; Note that this does not return state (see :doc read-file-into-string
    ;; for an explanation).
    (defund read-file-into-character-list (filename state)
      (declare (xargs :guard (stringp filename)
                      :stobjs state))
      (let ((string (read-file-into-string filename)))
        (if (not string)
            nil
          (coerce string 'list))))