Any other things needed in AnnotatedBackups?

Took a quick look at your code - problem of deleting wrong files is obvious and stuck out like a sore thumb. Found, also, you are using code from my post not the original routine. That is why there is a statement you don’t understand. My code was the the modified version of the original used in the automated process. You would have known that if you read all the documentation (which BTW also resolves the modify flag & the Base Document determination I was so quick to answer you with).

Here’s the problem line in PruneBackupsToMaxSize:

Left(stFileName,Len(sDocName) ) = sDocName And _

@Ratslinger, V 1.5.11 moves cancel ahead of save, removes illegal file name characters, and removes canceled confirmation dialog. This line of code you cite above comes from your own code, if sDocName = Left(stFileName,Len(sDocName)) and in TimedBackupReplacementMacro.odt. I can only guess my code is not working for you because you also are using TimedBackups which I imagine is incompatible, and I never claimed to support, nor use. I was never interested in timed backups for development.

@Ratslinger, So this is working quite well for me on Linux Base, Calc, Draw, Impress, Math, and Writer, without any of the problems you cite. All names work just as expected. All purges work just as expected. Even undo is preserved. So I’m getting ready to move to a beta release. I’ve written up a nice installation guide and other documentation at the wiki. Also you might have already noticed that I split the code into settings and other which makes future updates retain settings.

Well this concludes any further testing for me. This is the worst yet. First, I don’t use any backup routines at all. Don’t have need. Second, that is not quite the line from my code. Part of that line is If Len(testString) = Len(stFileName) then which you commented out and thus creating your problem. Third, just tried latest code. Missing subroutines & at least one other line of code (missing )). No way to even test. You should test what you post.

I stand corrected on the missing routines. Found in another location. Would have never guessed. Still error in other code.

@Ratslinger, That line was removed so filenames could be variable length, i.e. they now have a comment, not just a time stamp suffix. The purge does pretty much what you originally designed it to do: tests for a base filename match, and filename extension match. But now we can’t test for filename length. So if you have other files in that directory with the same name and extension (of any length) they are at risk of getting confused with the timestamped files. Only the comment is ignored.

@Ratslinger, Upon reflection, I think I’ll remove or discourage the option to put the backups in the same directory as the original. I just kept it the way it was, but now I realize that is a potential problem too. Thank you for testing this. There is another important issue I found today, so there will be another update once I find a solution to that. It’s noted at github under issues.

I don’t think you understand. I could’t care less which utility people use. There’s the original which works from a toolbar click. There’s the automated which saves based upon time if changes are made and there is yours which is the original with database saving. I am not the author of any of these so I only look at the results. In my humble opinion, I think you’re missing the boat on what you should be concentrating on - something specific to DB’s.

The problem I have with your is the potential loss of backups and taking away the users options. If I have (and I do this a lot) a file (any kind) named “a.xxx” and use the backup it saves as (crude rep) “aDDDTTT.xxx”. Now I save my original as “a1.xxx” (my own reasons) and use the backup it becomes “a1DDDTTT.xxx”. When I go back to “a.xxx” and use a backup this is where the problem of loss of backups occurs. Has nothing to do with originals in same directory as backups.

The other thing I totally disagree with is your save the original for the user. You take the choice out of their hands. I’ve mentioned maybe I didn’t want a save but rather a “save as” since I don’t want the changes in my original file. This is easy as noted in the automated routines - don’t save the original; before saving the backup check the isModified flag & if on reset it after the saved backup.

I know why you deleted the line mentioned, it is simply that you failed to then accommodate for what it did in insuring the files are of matching types. This can be demonstrated time & again using the test method presented early in these comments.

OK. Have given you the test for the problem and the line of code where it occurs. Now here is a fix for the problem (crude but it works).

Dim MyPos as integer
Dim MyComp as integer
MyPos = InStr(stFileName, "--")
MyComp = Len(sDocName)
	If _
		Left(stFileName,Len(sDocName)	) = sDocName		And _
		MyPos = MyComp + 1 And _
	   Right(stFileName,3				) =

Thanks for your a.xxx problem description. I finally understand what was happening to you. Have fix, but want to test it more, …as one strange thing happened in it, that then went away. I got my head stuck and couldn’t see before what you were trying to call my attention to. :-/ Bugs. Also had a 6" centipede crawl out from under my desk last night. Finally found the bugger and vacuumed him up.

Thanks for your interesting suggestion. Didn’t see it till this am after I had already patched yesterday using separate subdirs for each file. (Not sure why delayed.) (BTW, did you notice anything strange about this site recently? Overnight I got 100+ karma points added by someone. That’s unusual. Wonder if something went bonk with AskLibreOffice.org?) Anyway I’m still smarting from being burned by my last bug mistake. Think will stick w/ subdirs for now since it’s already in place.