Author Topic: Question about modifying the save command or custom commands...  (Read 4046 times)

hbean

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Good morning all!

(Hopefully) quick question for you all...

Were attempting to move our server code over to a SVN source control.  Part of this is getting the modified code back from our personal machines to the server to be compiled.  Ideally, we'd like to have vslick automagically save the file locally, and save the file on our samba mapped drive, then bash scripts take it from there.  We're not finding any convenient way to do this.  We attempted to use file backup, but it doesn't fit our needs as it seems to be saving some sort of extra data into the file it creates.

Any ideas?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2625
  • Hero Points: 141
Re: Question about modifying the save command or custom commands...
« Reply #1 on: August 18, 2009, 08:31:05 pm »
Anytime you save a file, you want it to be written to another location, whose path can be calculated?

hbean

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Question about modifying the save command or custom commands...
« Reply #2 on: August 18, 2009, 08:48:27 pm »
the path would always be the same, for that particular user, for example, for me, it would be

f:\hhb\somesubdirectory\

f being our mapped drive via samba.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2625
  • Hero Points: 141
Re: Question about modifying the save command or custom commands...
« Reply #3 on: August 19, 2009, 12:35:17 pm »
So when you save c:\hhb\dir1\dir2\dir3\File1.cpp you want it to also be saved to f:\hhb\dir1\dir2\dir3\File1.cpp?

hbean

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Question about modifying the save command or custom commands...
« Reply #4 on: August 19, 2009, 03:14:42 pm »
yah, thats the idea.

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Question about modifying the save command or custom commands...
« Reply #5 on: August 19, 2009, 06:53:19 pm »
I suspect it would be pretty easy to write a hook for the Save event.  In that, you would save the file to the alternate location.

You could even put that alternate location in a variable, so it could be changed w/o modifying the macro.

The necessary prefix for your macro name escapes me...

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2625
  • Hero Points: 141
Re: Question about modifying the save command or custom commands...
« Reply #6 on: August 19, 2009, 06:55:56 pm »
_cbsave_<name> - _cbsave_ is the prefix.  I've been waiting until I have time to do a proper sample but it is something like:

int _cbsave_copy_file(...)
{
   copy_file(p_buf_name,NEWNAMEGOESHERE);
   return(0);
}