From 64aeafac79d72f440b6546bae91583e6efd6b674 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 1 Jun 2013 07:35:18 +0000 Subject: Support --output in compiler, for bootstrapping stage. --- src/lisp/core.lisp.in | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/lisp') diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in index 38183144..4b72e76f 100644 --- a/src/lisp/core.lisp.in +++ b/src/lisp/core.lisp.in @@ -3,7 +3,7 @@ ;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. ;; All rights reserved. ;; -;; Copyright (C) 2007-2012, Gabriel Dos Reis. +;; Copyright (C) 2007-2013, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -103,7 +103,8 @@ "$InputStream" "$OutputStream" "$ErrorStream" - + + "directoryEntries" "inputBinaryFile" "outputBinaryFile" "inputTextFile" @@ -551,6 +552,22 @@ (defparameter |$OutputStream| (make-synonym-stream '*standard-output*)) (defparameter |$ErrorStream| (make-synonym-stream '*standard-output*)) +;; Return all entries (except dot and dot-dot) in a directory +(defun |directoryEntries| (dir &optional (pattern nil)) + (let ((dirname (namestring dir))) + (cond (pattern (directory (concatenate 'string dirname "/" pattern))) + (t ;; list everything. + ;; There are two groups: those who do the right and obvious thing; + ;; and those that are anal-retentive about it. + #+(or :clisp :clozure :gcl) + (directory (concatenate 'string dirname "/*")) + #-(or :clisp :clozure :gcl) + (nunion + (directory (concatenate 'string dirname "/*")) + (directory (concatenate 'string dirname "/*.*"))))))) + + + (defun |inputBinaryFile| (f) (open f :direction :input -- cgit v1.2.3