Marty Knapp wrote:

> I have an app that allows user to create specialized editable
> documents (stacks) that open in my app. Some customers use Dropbox,
> iCloud, OneDrive or similar to store these documents so that they
> can be accessed from 2 different computers. Is there a way to tell
> if a stack is already open on one computer? I need to prevent them
> from opening a 2nd instance of the stack on the other computer so
> that Dropbox (or other cloud sync service) does not create a
> conflicted copy.

Nextcloud is the only file syncing system I know of that provides an API for file locking, but given the nature of syncing systems it comes with a good many caveats, noted here:

https://docs.nextcloud.com/server/20/admin_manual/configuration_files/files_locking_transactional.html

I have a similar need to support distributed workflows through syncing systems, and after reviewing those notes and other discussions it's became clear to me that with sufficient editing frequency conflict files are unavoidable, so now I'm focusing on smarter conflict-file resolution.


> If there is not a way to tell, has anyone created some sort of stack
> check-out/check-in system that they'd be willing to share?

File syncing involves latency, and in those delays between saves and updates across all distributed clients there will inevitably be conflicts.

Even if you use a lock file as a semaphore for other clients to know that a file is being edited, that semaphore itself needs to be distributed through the same inherently-latent system, and therefore is prone to arriving too late to be of any value.

When data integrity is critical and conflict-file resolution is not a clean option, I can think of no other solution than to maintain storage of the files on a server, where check-in/check-out can be handled explicitly and immediately.

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 ____________________________________________________________________
 ambassa...@fourthworld.com                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to