Users could rename/move a database file while my (Mac OS X) program has made an SQLite connection to the file. I want to handle this properly.
Mac OS X (Unix) has ways to track a file that is renamed/moved, so if I can get enough information about how SQLite works in this regard, handling this should be possible. Below is a question that I believe I need answered to be able handle this properly, but feel free to add more thoughts of your own if you think I need more information. QUESTION: What error codes can each of the following functions possibly return while the database file is renamed/moved during the execution of the function? * sqlite3_open() * sqlite3_prepare_v2() * sqlite3_step() * The various "sqlite3_column()" functions - could they return something unexpected? * sqlite3_finalize() * sqlite3_close() My thinking is that if I knew all the possible error codes, I could - upon such an error - check if the file was renamed/moved. If it was, I could close and reopen the database connection on the new path and continue/restart execution as required. If it was not renamed/moved, it would be a genuine error to be handled like any other error. (And of course, I would perform the renamed/moved check in between the SQLite function calls, but that's not related to SQLite per se.) Again, you're welcome to add your own thoughts to the mix. Thank you. I'm using SQLite 3.8.1. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

