Unified treatment of files
Currently there are two possibilities for File objects in CaosDB that lead to different behavior:
-
- A file was inserted using the standard insert API method and resides directly in the CaosDB root file system.
-
- A file was inserted using the "create link" method, which is the de-facto default for all crawler based applications. The file itself does not reside in the CaosDB root file system, but on an external file system, but a symlink exists to the corresponding location in the CaosDB root file system.
There are important implications, especially in setups, where both methods are used simultaneously:
- On deletion of a CaosDB file entity created with method 1, the actual real file will vanish, while in case of method 2, only the symlink will vanish and the original file is preserved. It is impossible to identify this difference in behaviours e.g. from the web frontend, as it is not possible to see whether the file behind the file entity is a symlink or a real file.
- Files inserted with method 1 will be part of the standard CaosDB file backup, file there will be only a corresponding symlink in case of method 2.
- ...
I think the current mix of methods for inserting files can lead to unpredictable behaviour, and therefore there should be only one way to insert files into CaosDB.