Dublin, Ireland
+353 87 41 86 742

Modified Files Script

Configuration Management Systems / Source Control Software -  All software developers encounter these things, tools that help you synchronise work across a team, controlling access to files and sharing resources with everyone. - Well at least they are supposed to 🙂

Good good few of the available mainstream source control systems rely on blocking access to files to manage the way developers interact with the source control system. For instance one person checks a file out and at that point no one else can use it. The system maintains control over what files a developer can modify by toggling the read only flag on the file. By default all files are read only, the developer has to “check out” the file before it becomes writable. There are notable exceptions to this method of working notably CVS and Subversion. However Visual Source Safe and Perforce are two examples of systems that enforce this method of working.

While this is handy in collaborating effort and ensuring that only one person changes the file at the time it can be restricting. How many times have you needed a file checkout by someone else, possibly some one who's out of the office and not due back for a while.

The way around this as many developers will know is to simply unlock the files yourself bypassing the control software, simply using the attrib command at the DOS prompt you can strip the read only flag from the file and edit away. The intention being to check in the changes at a later date.

Oh how many times have I forgot I've done this?! - How many times have I got the latest version of code from the repository and over written the changes I've made... still makes me cringe!

Well I've got a solution! - Versions of Windows 98 onwards (I think) contain a console based jscript engine. So I've written a little script. It goes through the contents of a directory, and all of it's subdirectories and lists out to the console the names and paths of each of the modified files ( ie files with the read only flag not set ).

I extended this further to copy each modified file to a different location as a back up, this is not complete yet as it doesn't recreate the original directory structure, however it is a start.

It's a bit rough around the edges at the moment, but then as log books go this is often the way. The script and a batch file which invokes it are available in the attached zip file.

NB: The batch file assumes that the script is located at C:

Example usage:
        modfiles c:some-dir-under-source-control
modified file list appears on screen

modfiles c:some-dir-under-source-control /D c:backup-destination
modified file list appears on screen & files are “dumped” to backup destination

No Comments Yet.

Leave a Reply