Author Topic: can i set backup history directory path using every project file directory?  (Read 3638 times)

sjgsjg

  • Community Member
  • Posts: 10
  • Hero Points: 0
can i set backup history directory path using every project file directory?
« Last Edit: December 21, 2010, 09:10:03 am by sjgsjg »

Scott H

  • Senior Community Member
  • Posts: 240
  • Hero Points: 9
I'm not sure what you mean here... do you want to set the backup history path to a different value for each project you work with?  Right now, backup history can only be configured to use a single directory.

Graeme

  • Senior Community Member
  • Posts: 1978
  • Hero Points: 226
Dunno if this'll help but what I do is in vslick.ini in the configuration folder I have

[Environment]
VSLICKBACKUP=./SlickEdit-backups

which results in the vsdelta backup files getting put in a sub-folder of the folder containing the source file being backed up.  This means that the backup files are stored with the project they belong to.

Graeme

Scott H

  • Senior Community Member
  • Posts: 240
  • Hero Points: 9
Hey, that's a cool trick!  Today I learned something new, thanks!

sjgsjg

  • Community Member
  • Posts: 10
  • Hero Points: 0
Dunno if this'll help but what I do is in vslick.ini in the configuration folder I have

[Environment]
VSLICKBACKUP=./SlickEdit-backups

which results in the vsdelta backup files getting put in a sub-folder of the folder containing the source file being backed up.  This means that the backup files are stored with the project they belong to.

Graeme

thanks for Graeme and Scott H ! i try do....
« Last Edit: December 23, 2010, 03:37:39 am by sjgsjg »

sjgsjg

  • Community Member
  • Posts: 10
  • Hero Points: 0
Dunno if this'll help but what I do is in vslick.ini in the configuration folder I have

[Environment]
VSLICKBACKUP=./SlickEdit-backups

which results in the vsdelta backup files getting put in a sub-folder of the folder containing the source file being backed up.  This means that the backup files are stored with the project they belong to.

Graeme

thanks again! it's a good idea,But that is not my most wanted,i hope the backup files are stored in a single directory,and the directory same as each project file (*.vpw) path
« Last Edit: December 23, 2010, 03:46:14 am by sjgsjg »

Graeme

  • Senior Community Member
  • Posts: 1978
  • Hero Points: 226
You could try this macro but I don't know if it's what you want.

Code: [Select]
#include "slick.sh"
 
void _workspace_opened_set_backup_dir()
{
   set_env('VSLICKBACKUP', strip_filename(_workspace_filename, 'N'));
}

This sets the backup folder path to be the same as the location of the workspace file and is executed when you open a workspace.  It doesn't put all your backup files in a single folder  - that would create name clashes.  Instead it creates a folder tree rooted in the specified folder.  If you want to try it, add the above code to vusrmac.e (in your configuration folder) and load it using the load module command on the macro menu.  To "unload" it, delete (or comment) the above code and reload vusrmac.e.

If you re-locate the project, your "backup folder tree" will become invalid and you may need to copy part of it manually.

Graeme

sjgsjg

  • Community Member
  • Posts: 10
  • Hero Points: 0
 :),This method is useful for,Although a little defect----after re-locate the project, "backup folder tree" will become invalid

Graeme

  • Senior Community Member
  • Posts: 1978
  • Hero Points: 226
:),This method is useful for,Although a little defect----after re-locate the project, "backup folder tree" will become invalid

Yeah, but don't forget you can copy the "lower" part of the backup folder tree to a new backup folder tree branch of which the "upper" part corresponds to the new location of the project, mimicking what you did to move the project files themselves.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1958
  • Hero Points: 81
Hero point for Grame's clever solution.

The only thing to be careful of here is that because the path is mimic-ed under the backup directory, exceeding the length limit of a path is a possibility.  If your source is in "c:\src\proj1", you will actually be less likely to have this happen using this method, but if it were nested somewhere in a path that is longer than the default in My Documents, it would be more likely to happen.

I tend to use one global path because I tend to work in many editors, but that is not necessary for everybody.