-1

I have a hard drive that is shared on a local network. The number of users is small, under 5. The drive is shared from Windows (Windows 11), but needs to be accessed by both macOS (Big Sur +) and Windows (Windows 10/11).

My problem is that I don't want two users to unknowingly open the same file, edit it, and then try and save their changes, overwriting one user's work. From my experimentation (with plaintext files), neither Windows nor macOS warns the user when opening a file if it is already open on a different computer. MacOS does warn before saving a file that has been changed on another computer, but Windows does not.

I'm looking to enable one of the following:

  • On Windows, a warning before saving a file that the file has been changed externally since it was opened.
  • Or, ideally, a warning when opening a file that that file is already open on another computer (macOS and Windows).

Can either/both of these be done? Can these be done for the entire shared drive for all files?

I'm open to solutions that involve regular settings, the command line, scripting, or even third-party software. (I'm not looking for any cloud-based solutions, as this network needs to be completely functional offline.)

  • How macOS and Windows handle file handles indicating a file is open is entirely different. Your unlikely to find a solution to the problem you describe. The application is responsible for warning you a file is already opena and unavailable to be saved. – Ramhound Dec 14 '22 at 02:36

1 Answers1

1

The same issue is a concern in databases and source code management: what happens when two users try to change the same data at the same time? Likely you could use a source code management tool to enable users to either lock a file (pessimistic concurrency control) which is to be edited, or to use optimistic concurrency control, which "allows multiple users to attempt to update the same [file]." In the second case, the management tool has to be able to compare changes made simultaneously, and resolve the differences, either without user intervention (e.g., where changes are made to completely different section of a document), or, in many cases, with user(s) reviewing the changes and accepting or modifying some.

My personal experience is that pessimistic (lock) control is easier to implement, and causes fewer conflicts, though if many users want to edit the same document, waiting for a lock to be released can be a nuisance.

Apache Subversion (SVN) is a free, open source, versioning and revision control system you might try, and clients are available for macOS, Linux and Windows. There are numerous alternatives, as well.

DrMoishe Pippik
  • 25,661
  • 4
  • 36
  • 54