Paste number 327912: untitled

Index of paste annotations: 1 | 2

Paste number 327912: untitled
Pasted by: htgoebel
When:5 years, 1 month ago
Share:Tweet this! | http://paste.lisp.org/+710O
Channel:None
Paste contents:
Raw Source | XML | Display As
former_files = (find-files "build" "\\.egg-info$" #:directories? #t)
(do-something)
later-files =  (find-files "build" "\\.egg-info$" #:directories? #t)
for-each name in later-files
     if not name in former_files:
        (delete-file-recursivly name)


Alternative: Using sets:
               
former_files = (find-files "build" "\\.egg-info$" #:directories? #t)
(do-something)
later-files =  (find-files "build" "\\.egg-info$" #:directories? #t)
for-each name in set(later-files) - set(former-files)
     (delete-file-recursivly name)

Annotations for this paste:

Annotation number 1: untitled
Pasted by: htgoebel
When:5 years, 1 month ago
Share:Tweet this! | http://paste.lisp.org/+710O/1
Paste contents:
Raw Source | Display As
My current approach:

      (let (egg-dirs1 (find-files "build" "\\.egg-info$" #:directories? #t))
        (call-setuppy test-target '() use-setuptools?)
        (let (egg-dirs2 (find-files "build" "\\.egg-info$" #:directories? #t))
          (for-each delete-file-recursively
                    (lset-differnence eqv? egg-dirs2 egg-dirs1)

Annotation number 2: untitled
Pasted by: rekado
When:5 years, 1 month ago
Share:Tweet this! | http://paste.lisp.org/+710O/2
Paste contents:
Raw Source | Display As
;; with sets

(use-modules (srfi srfi-1))
(let ((before (find-files "build" "\\.egg-info$" #:directories? #t)))
  (do-something)
  (let* ((after (find-files "build" "\\.egg-info$" #:directories? #t))
         (inter (lset-difference before after)))
    (for-each delete-file-recursively inter)))

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.