Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun diff-strings (string1 string2)
- (let (realpath1 realpath2 fullpath return)
- (uiop:with-temporary-file (:pathname path1 :keep t :directory "/tmp")
- (uiop:with-temporary-file (:pathname path2 :keep t :directory "/tmp")
- (with-open-file (file1 path1 :direction :output)
- (with-open-file (file2 path2 :direction :output)
- (setq realpath1 path1
- realpath2 path2)
- (princ string1 file1)
- (princ string2 file2)))))
- (setq fullpath (list "/usr/bin/diff" (uiop:native-namestring realpath1) (uiop:native-namestring realpath2)))
- (setq return (uiop:run-program fullpath
- :output :string
- :ignore-error-status t))
- (uiop:delete-file-if-exists realpath1)
- (uiop:delete-file-if-exists realpath2)
- return))
Advertisement
Add Comment
Please, Sign In to add comment