I am running into more and more of an issue with file sharing services corrupting files I write to using the database commands.
This is happening on Windows and Mac, basically I open the DB file, write and then close it, I don't leave it open. But sometimes when the database is opened again the system gets a revdberr malformed and when the user sends me a backup of their data files the database is corrupt. In evey case they are using some form of file backup sync, dropbox etc.
Is there a way in livecode to lock a file so these file sync services leave it alone until the file is unlocked or the app is closed etc?
Locking Files
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 8322
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Locking Files
Dropbox and similar file syncing services are notorious for corrupting sqLite files. This is one of the better discussions on that:
https://forums.zotero.org/discussion/66 ... a-solution
I'm not sure that local file locking alone with solve the issue. Depending on how the syncing service handles that, it may just result is multiple "conflict" files, so the DB might be OK but then there's the new task of reconciling diffs between conflict copies.
Dropbox, Nextcloud, iCloud, and most others provide an API for use-cases not handled well with default syncing. That may be your best bet with this. I've been reading about this issue for many years across a wide range of apps, and I haven't yet come across any robust general solution other than recommendations to use the APIs.
https://forums.zotero.org/discussion/66 ... a-solution
I'm not sure that local file locking alone with solve the issue. Depending on how the syncing service handles that, it may just result is multiple "conflict" files, so the DB might be OK but then there's the new task of reconciling diffs between conflict copies.
Dropbox, Nextcloud, iCloud, and most others provide an API for use-cases not handled well with default syncing. That may be your best bet with this. I've been reading about this issue for many years across a wide range of apps, and I haven't yet come across any robust general solution other than recommendations to use the APIs.
Richard Gaskin
Community volunteer LiveCode Community Liaison
LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Community volunteer LiveCode Community Liaison
LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/