Index: remotediff-nmsg.scm ================================================================== --- remotediff-nmsg.scm +++ remotediff-nmsg.scm @@ -17,14 +17,14 @@ (if (not (eq? eid cid)) (set! (current-effective-user-id) eid)))) ;; use mutex to not open/close files at same time ;; -(define (checksum mtx file) +(define (checksum mtx file #!key (cmd "shasum")) (mutex-lock! mtx) (let-values (((inp oup pid) - (process "shasum" (list file)))) + (process cmd (list file)))) (mutex-unlock! mtx) (let ((result (read-line inp))) ;; now flush out remaining output (let loop ((inl (read-line inp))) (if (eof-object? inl) @@ -45,12 +45,12 @@ (threads (make-hash-table)) (last-num 0) (req (nn-socket 'req))) (print "starting client with pid " (current-process-id)) (nn-connect req - "tcp://localhost:5559") - ;; "ipc:///tmp/test-ipc") + ;; "tcp://localhost:5559") + "ipc:///tmp/test-ipc") (find-files path ;; test: #t action: (lambda (p res) (let ((info (cond @@ -71,11 +71,11 @@ (if ok-to-run (let ((run-time-start (current-seconds))) ;; (print "num threads: " num-threads) (let ((th1 (make-thread (lambda () - (let ((cksum (checksum mtx1 p)) + (let ((cksum (checksum mtx1 p cmd: "md5sum")) (run-time (- (current-seconds) run-time-start))) (mutex-lock! mtx1) (client-send-receive req (conc p " " cksum)) (mutex-unlock! mtx1)) (let loop2 () @@ -120,12 +120,12 @@ (rep (nn-socket 'rep)) (p1len (string-length path1)) (p2len (string-length path2)) (both-seen (make-hash-table))) (nn-bind rep - "tcp://*:5559") - ;; "ipc:///tmp/test-ipc") + ;; "tcp://*:5559") + "ipc:///tmp/test-ipc") ;; start clients (thread-sleep! 0.1) (system (conc "./remotediff-nmsg " path1 " &")) (system (conc "./remotediff-nmsg " path2 " &")) (let loop ((msg-in (nn-recv rep))