August 29, 2006 at 7:15 pm #1949dempseyParticipant
When I edit foo.bar, I want to backup file to be named foo.bar.bak. This makes all the difference when editing CMyDialog.cpp and CMyDialog.h.
How can this be done?August 29, 2006 at 7:49 pm #6681womParticipant
An excellent suggestion. If someone has the answer or if that could be added for the future I would like that also. I work mainly in three languages (Ada, Modula-2 and Delphi) and in two of those (Ada and Modula-2) I have exactly the same problem with only getting one .bak file if I edit both files of a single package (i.e. MyFile.ads and MyFile.adb for Ada and MyFile.def and MyFile.mod for Modula-2)
I would imagine that the idea of replacing the extension with .bak all the time is just a holdover from DOS days so no reason that it couldn’t be changed now to simply add on .bak right?August 29, 2006 at 8:44 pm #6682Clay MartinKeymaster
One solution might be to change from using bak to using a backup directory. If you go to Tools-Customize-Files-Backup you can specify using a backup directory instead of renames. By default the directory is <User_Path>Bak but you could change <User_Path> to something more useful like the project directory <PROJECT_FILEPATH>. You can see what your meta command options are in the help file (just serch for <User_Path> and select General Command Line Metacommands topic.
ClaySeptember 7, 2006 at 8:32 pm #6724ReidSweatmanParticipant
Roger that, and copy Clay. Better to just make it a project matter. Especially since Windows can get squirrelly with more that one non-consecutive dot in a file- or folder-name. It’s supposed to work, but you pays your money and takes your chances. I’ve seen it fail more times that I care to mess with.
The Rogue CodewarriorSeptember 12, 2006 at 11:24 pm #6739Bret SuttonParticipant
I’d like to issue a caveat here on the use of metacommands in the backup path. These metacommands are evaluated at the time you complete the dialog, or whenever you start Multi-Edit. Therefore, when the file is backed up, the backup path may not be what you expect.
I wanted the backup path to always be the BACKUP subdirectory of the directory in which the file resides. So I specified <PATH>BACKUP. That expanded simply to BACKUP/ upon dialog completion – which was the value stored in Backup_Path. The global variable !BACKUP_PATH did contain what I specified, but it’s not really used anywhere except as a storage location for the value shown in the Customize dialog box.
I don’t use projects, so cannot give a definitive answer in the case of <PROJECT_FILEPATH>. I’m guessing it would work as long as you never switch projects in the middle of a Multi-Edit session; or if you restart Multi-Edit after switching projects; or if you go to the Customize dialog and simply OK out of it after switching projects.
So it appears that we can’t use metacommands to establish a dynamic backup path.
- You must be logged in to reply to this topic.