[generate-audio-pathname now guarantees a unique file name clinton@unknownlamer.org**20080104211650 If multiple files were created in the same second the last to be written would clobber the others. ] { hunk ./src/database.lisp 92 -(defun generate-audio-path-name () - "Generate path name for audio files" - (make-pathname :host "golf" - :directory "audio" - :name (metabang.utilities:unique-file-name-from-date - "audio" - :type nil))) +(let ((audio-random-state (make-random-state t))) + (defun generate-audio-path-name () + "Generate a unique path name for audio files" + (let ((path-name (make-pathname :host "golf" + :directory "audio" + :name (metabang.utilities:unique-file-name-from-date + (format nil "~A-~D" + "audio" (random 1000 audio-random-state)) + :type nil)))) + (if (file-exists-p (translate-logical-pathname path-name)) + (generate-audio-path-name) + path-name)))) + + hunk ./src/database.lisp 170 + +;; Query Protocol + + hunk ./src/packages.lisp 18 + (:import-from :cl-fad :file-exists-p) }