SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: hbean on August 18, 2009, 03:31:35 pm

Title: Question about modifying the save command or custom commands...
Post by: hbean on August 18, 2009, 03:31:35 pm
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?
Title: Re: Question about modifying the save command or custom commands...
Post by: Dan 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?
Title: Re: Question about modifying the save command or custom commands...
Post by: hbean 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.
Title: Re: Question about modifying the save command or custom commands...
Post by: Dan 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?
Title: Re: Question about modifying the save command or custom commands...
Post by: hbean on August 19, 2009, 03:14:42 pm
yah, thats the idea.
Title: Re: Question about modifying the save command or custom commands...
Post by: Wanderer 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...
Title: Re: Question about modifying the save command or custom commands...
Post by: Dan 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);
}