I want Backup Files to be named foo.bar.bak

Product Compare Forums Multi-Edit Support I want Backup Files to be named foo.bar.bak

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #1949

    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?


    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?

    Clay Martin

    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.



    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.

    Reid Sweatman
    The Rogue Codewarrior :twisted:

    Bret Sutton

    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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.