Reputation: 19918
I'm currently working with someone who categorically refuses to use a proper source code VCS. I'm also frequently required to live edit files on a server using SSH while he is doing the same. I was wondering if there are any simple text editors out there which use a simple pessimistic locking system to indicate which files are currently being edited so we don't overwrite each others changes. I believe Vim does something like that but I don't think I can get my co-worker to use Vim (I believe he currently uses Nano / Textmate over SSH although I'm not sure).
What I'm really looking for is a temporary to this problem and preferably, the solution should be as low tech as possible.
Upvotes: 0
Views: 69
Reputation: 206607
My recommendation:
If you are on a platform that has a BASH environment, create a wrapper BASH script. In the BASH script, look for a lock file. If the lock file exists, don't proceed. If the lock file does not exist, create the lock file and then proceed to the edit step. Use an environment variable, something akin to EDITOR, to choose your preferred text editor.
If you are in an environment that not have a BASH environment, find an appropriate scripting tool and follow the same path.
Upvotes: 2