If there are multiple people working on the same model file as a team, how do we avoid inadvertently overwriting changes made by other team members?
In a team environment where multiple people are contributing to changes to the same model file, a batch file can be used to manage file 'check-out' and 'check-in' in a way that helps avoid overwriting changes made by other team members. Download the linked zip file (at the bottom of the article) to see an example of how this can be done.
The zip file contains a batch file and a folder with an example model file and supporting Excel files (for input and output). The folder containing the model file can be stored at a common location that everyone on the team can access. When the batch file is run (e.g. by double-clicking), a copy of the model folder (and contents) is made in the directory where the batch file was run (i.e. the target location). At the source location (where the model folder is located), a temporary folder is created and the original source files are stored in the temporary folder. When the team member who is editing the model saves the model and closes GoldSim, the source folder is moved back out of the temporary folder and the edited files are written back to the source location (overwriting the original source files with the updated files).
If someone is editing the model and another team member runs the batch file, the latter will receive a message in a command window indicating that the model folder was not found. Only when the first team member is done editing the model and closes GoldSim will the source files be updated and made available again (they will be moved back out of the temporary folder).
Be sure to read the comments at the beginning of the batch file for a description of what lines need to be changed before running it. Specifically, the GoldSim file name, the source folder name, the path to the source folder and the path to the GoldSim.exe executable all need to be specified in the batch file. The screenshots below show the lines that need to be edited.
Edit the right-hand sides of each of the four expressions (i.e. the lines beginning with @SET). For 'ModelFolderLocation' and 'GoldSimInstallationFolder', be sure to include the backslash at the end (just before the double quote mark).
Disclaimer: The script-based solution to file management that we present here is provided as-is with no guarantees as to its reliability in ensuring that a file edited by one team member is not overwritten by another. It is one possible solution for file management and should not be considered a robust replacement for commercial data file management solutions. Users should be mindful of situations in which the reliability of this script-based solution may be compromised. For example, if GoldSim crashes or a network connection fails after check-out, a proper check-in may not occur.