From b7abc32ec05dd1cdf19a16bd53a7b10e1edd09c3 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Wed, 12 Oct 2022 20:21:46 +0200 Subject: [PATCH] Ignoring new (index|partition) symlink errors. --- src/dodb.cl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/dodb.cl b/src/dodb.cl index 71c0710..e7e588b 100644 --- a/src/dodb.cl +++ b/src/dodb.cl @@ -46,6 +46,8 @@ (data (make-hash-table)) ; {Int -> struct} ) +; db/new ensures directory '/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".