X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=os.lisp;h=cce2a2f99fe80f7b221487d08d01ad1f2a20a3c1;hp=5b6fff3aa3d90aad02dd8ce57fa88f25c0560f87;hb=e96b017d2a09ffd9c9279cb4c2341c53f0581022;hpb=e55fe0dc654bb7cd01e978a7080b6087788f173f diff --git a/os.lisp b/os.lisp index 5b6fff3..cce2a2f 100644 --- a/os.lisp +++ b/os.lisp @@ -60,7 +60,8 @@ returns (VALUES string-output error-output exit-status)" (let ((status (system:call-system-showing-output command - :shell-type "/bin/sh" + :prefix "" + :show-cmd nil :output-stream output))) (values (get-output-stream-string output) nil status)) (close output))) @@ -119,7 +120,9 @@ returns (VALUES output-string pid)" (system:call-system-showing-output command :shell-type "/bin/sh" - :output-stream output) + :show-cmd nil + :prefix "" + :output-stream nil) #+clisp ;XXX not exactly *verbose-out*, I know (ext:run-shell-command command :output :terminal :wait t) @@ -148,3 +151,11 @@ returns (VALUES output-string pid)" (command-output cmd))) ((eq if-does-not-exist :error) (error "Directory ~A does not exist [delete-directory-and-files]." dir)))) + +(defun file-size (file) + (when (probe-file file) + #+allegro (let ((stat (excl.osi:stat (namestring file)))) + (excl.osi:stat-size stat)) + #-allegro + (with-open-file (in file :direction :input) + (file-length in))))