On 26 May 2016, at 6:04pm, Dan Kennedy <danielk1...@gmail.com> wrote:
> On UNIX, it's possible to delete a file from the file-system while another > process has it open. In this case the other process can continue reading and > writing its file-descriptor as normal, but the data is stored in memory only, > not on disk (since the directory entry has been deleted). Once the process > exits or closes the file-descriptor, the data is lost. This is not how it's normally described. I wouldn't normally be this finicky but the difference plays a part in answering the question. The file itself always exists on disk, even if you have deleted the last directory entry that points to it (hard links under unix are additional pointers to the same file). When a file is closed, or the process holding it open quits or crashes, Unix removes the entry for that file from a list of open file descriptors in memory. Each time it does so, it checks to see if there are any pointers to that file elsewhere in the file descriptor list or on disk. If there are no pointers remaining then it deletes the file by returning the list of data blocks it occupied to the list of free data blocks. Sometimes the whole computer can crash while a file is in the 'no directory entry but a process still has it open' situation. Clearing up after this happens is what makes files appear in the "lost+found" directory. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users