.bak files getting saved into last directory opened

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Post Reply
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

.bak files getting saved into last directory opened

Post by gwgs »

when saving edited files, if you have opened files with the open file dialog, from multiple directories, all the .bak files end up in the last location opened, not in the original file locations of the files being edited.

eg
zeus c:\temp\test.txt d:\temp\test2.txt
open d:\temp2\test3.txt with the file open dialog
save files,
all .bak files are in d:\temp2


Grant
jussij
Site Admin
Posts: 2464
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

What are the backup settings found in the Options, Editor Options menu, Backup panel :?:

Cheers Jussi
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Post by gwgs »

Backup Mode: Replace extension with .BAK

Backup Details:
Alternative backup directory: .
Do a periodic file backup every 5 minutes
Skip the backup for files larger than 0 MBytes


Grant
jussij
Site Admin
Posts: 2464
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Alternative backup directory: .

The . character represents the current directory.

With this setting I would expect to see the behaviour you are describing.

Each time you use the file open dialog you will be changing the current directory.

If you want the backup file to appear in the same folder as the file you should use the $fdd macro tag.

Cheers Jussi
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Post by gwgs »

Thanks Jussi, that works great
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Post by gwgs »

I am finding that i'm still getting .bak files for open files the the last directory opened, even with the $fdd as the backup path, this is with the 3.97p version and earlier versions.


Thanks

Grant
jussij
Site Admin
Posts: 2464
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Having given this some more thought it is clear the $fdd will not achieve the result you're after.

The $fdd represents the drive and directory of the active file so if you save the active file it will work.

But naturally if you use something like the file save all operation then $fdd will only represent the drive and directory of what ever is the active file at the time.

To achieve the result you're looking for I suggest adding a file save as trigger to make the backup in the correct folder.

Here is an example of how this can be done: http://www.zeusedit.com/zforum/viewtopic.php?t=6911

Cheers Jussi
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Post by gwgs »

as this is occuring with auto save I guess that is how it is happening.

I'll give the file save trigger a try when I get time.


Thanks

Grant
jussij
Site Admin
Posts: 2464
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

I'll give the file save trigger a try when I get time.

I had another look at the save trigger that I created earlier and it suffers the same issue of using the $fdd macro tag.

I wrote that macro based on a users request and in my haste to write that macro I resorted using those tags as they are very easy to use.

In any case I took a longer look at that macro and have made changes to it so that it no longer uses the macro tags.

The update macro can be found here: http://www.zeusedit.com/zforum/viewtopic.php?t=6911

Cheers Jussi
Post Reply