I first encountered VMS sometime in the 1980’s after having used an ICL1900 and a DEC System 20 and I’ve been a bit of a fan ever since, particularly of the file system which supports file versioning, which is something I still miss on more modern systems today.
Experienced VMS users will be very familiar with this but for anyone who is coming to VMS as a hobbyist for the first time I’ve put together some examples of some of the slightly less than obvious things you can do when copying, renaming and deleting files.
Starting with a folder containing two versions of a program we can use the ‘DIR’ command to display all the files in the folder.
One of the first things you will notice is that the different versions of the files have different permissions, normally new versions of existing files normally inherit the same permissions as the original. However in this case, I’ve deliberately modified the permissions of the original version to prevent it being accidentally deleted.
If you edit the source code then the system will save the modified version of the code in a new file, you don’t need to keep a backup copy, every time you edit (or copy) a file a new version will be created.
You can get rid of old versions of files you don’t want using the ‘PURGE’ command, by default this only keeps the latest version of each file but you can specify how many to keep. Having changed the file permissions the original versions of the files prevents them from being deleted – unless you are using a privileged account which can bypass file permissions, in which case be very careful what you do!
If you don’t specify a version number then the file specification will match only the most recent version of the file, unless the command acts on multiple files multiple files in which case it will match every version of the file, however if the version number is empty or blank then the file specification will only ever match the most recent version.
You can also specify previous versions of a file by using a negative version number, however when renaming a file all negative values are treated as if they were minus one.
When I want to keep the current version of a file, I create a new working copy, and then modify the file permissions on the last working version to prevent it being accidentally deleted or purged.
That’s all for now – but if you have any (useful) tips or tricks for working with different file versions on VMS let me know and I might add them to this page (if they are not too obscure!).