Ignoring new (index|partition) symlink errors.

draft
Karchnu 2022-10-12 20:21:46 +02:00
parent 080fcf426d
commit b7abc32ec0
1 changed files with 8 additions and 2 deletions

View File

@ -46,6 +46,8 @@
(data (make-hash-table)) ; {Int -> struct}
)
; db/new ensures directory '<path>/data/' exist,
; then loads values from existing files, if any, and puts them into db-data.
(defun db/new (struct-name path)
(ensure-directories-exist (concatenate 'string path "/data/"))
@ -130,7 +132,9 @@
; Generate index for all DB elements.
(maphash #'(lambda (number element)
(db/index/new database attribute-name element (number->filename number)))
(handler-case (db/index/new database attribute-name element (number->filename number))
(OSICAT-POSIX:EEXIST ()
(format t "db/new-index: symlink already exists, ignoring.~&"))))
(db-data database)))
; example: db-path/partitions/by_color/
@ -144,7 +148,9 @@
; Generate partition for all DB elements.
(maphash #'(lambda (number element)
(db/partition/new database attribute-name element (number->filename number)))
(handler-case (db/partition/new database attribute-name element (number->filename number))
(OSICAT-POSIX:EEXIST ()
(format t "db/new-partition: symlink already exists, ignoring.~&"))))
(db-data database)))
; Example: database -> "000000000000018".