[noctool-cvs] CVS source

imattsson imattsson at common-lisp.net
Wed Aug 27 18:07:00 UTC 2008


Update of /project/noctool/cvsroot/source
In directory clnet:/tmp/cvs-serv26584

Modified Files:
	tests.lisp 
Log Message:
IM

Slight re-work of parse-df and an auxilliary filtering function, merging
initial non-numeric "fields" together.


--- /project/noctool/cvsroot/source/tests.lisp	2008/08/26 15:54:29	1.6
+++ /project/noctool/cvsroot/source/tests.lisp	2008/08/27 18:06:59	1.7
@@ -32,12 +32,21 @@
 
 (defgeneric process-disk (monitor host))
 
+(defun parse-gobble (list)
+  (let* ((pos 0)
+	(first (loop for element in list
+		     for lpos from 1
+		     while (not (parse-integer element :junk-allowed t))
+		     do (setf pos lpos)
+		     collect element)))
+    (cons (format nil "~{~a~^ ~}" first) (subseq list pos))))
+
 (defun parse-df (pty)
   "parse output from df from the given pty"
   (read-pty-line pty) ;; throw away informational line
   (let ((ret NIL))
     (loop for line = (read-pty-line pty nil)
-       for split = (split-line line)
+       for split = (parse-gobble (split-line line))
        with last = NIL
        for len = (+ (length split) (length last))
        while line




More information about the noctool-cvs mailing list