dot in filename issue with new backup policy

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

dot in filename issue with new backup policy

Post by uwestoehr »

The new option to use the FCbak extension for backup files has a small but important issue:

It leads to filenames with 2 dots, e.g. "Filename.20200315-215654.FCBak". Some security and anti-malware programs (only on Windows I guess) will therefore trigger such files as potentially harmful, especially since also the FCBak extension is not known to those programs.

To overcome this, could the dot please be replaced by e.g. a hyphen: "Filename-20200315-215654.FCBak"
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: dot in filename issue with new backup policy

Post by Kunda1 »

uwestoehr wrote: Sun Mar 15, 2020 9:55 pm To overcome this, could the dot please be replaced by e.g. a hyphen: "Filename-20200315-215654.FCBak"
Let the dev know in the relevant forum thread. Should be in the PR

Edit:
plgarcia wrote::bell:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: dot in filename issue with new backup policy

Post by uwestoehr »

Kunda1 wrote: Sun Mar 15, 2020 10:57 pm Let the dev know in the relevant forum thread. Should be in the PR
The point is that merged PRs don't appear in the normal forum view anymore.

However, I found the PR: https://forum.freecadweb.org/viewtopic. ... 35#p377135
and added there a note to continue here visibly for all developers.
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: dot in filename issue with new backup policy

Post by plgarcia »

In fact what we can do is simply remove the . between the name and the date.
If somebody wants a - it can put it in the format what could be the default.

Tell me what you prefer either force a - instead of a . or move the separator in the format.
Regards
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: dot in filename issue with new backup policy

Post by uwestoehr »

plgarcia wrote: Fri Mar 20, 2020 10:13 am Tell me what you prefer either force a - instead of a .
Yes, this simple change would solve the issue.
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: dot in filename issue with new backup policy

Post by plgarcia »

OK I continue the analysis this week-end. To keep the number of archives we list the documents starting with the same name. I have to think a way to avoid confusions of the archives in this case. I often add a -1 -2 to a project name when I want to keep a version.

I take that this week-end.
Regards
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: dot in filename issue with new backup policy

Post by plgarcia »

New proposal
And what if we put the - between the date and the FCBak extension.
Eventially swap both FCBak-<the date>

Like that the part of the name before the . is alway what is to be compared in Backup policy.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: dot in filename issue with new backup policy

Post by uwestoehr »

plgarcia wrote: Fri Mar 20, 2020 12:46 pm Like that the part of the name before the . is alway what is to be compared in Backup policy.
I am happy with every solution as long as these 2 points are fulfilled:

- the filename has the suffix ".FCbak"
- there is only one dot in the filename and this the one before "FCbak"
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: dot in filename issue with new backup policy

Post by onekk »

why not a format date-name.FCbak

with date like YYYYMMDD?

On old UNIX trick to have them ordered by date.

In this manner almost every filesystem will list them in chronological order.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: dot in filename issue with new backup policy

Post by plgarcia »

Your way would mix the files of the different projects saved in the same folder. That is why the name followed by the date is a better way sorting.

The backup policy is base on the date of the file so that whatever the logic of the naming of the backup they can be properly ordered to delete the eldest ones if too many.
But to identify the files I must be able to relate the backups to the project files and therefore to distinguish between the name of the file and the added part. The first . is the way, and it is working very fine.

If we just replace the . by - imagine 2 projects.
project.FCStd
project-2.FCStd

They backups would have the form
project-202003-182325.FCBak
project-2-202003-182325.FCBak
The first - cannot be the criteria if we do not want to confuse between the archives of the 2 projects.

That is why I would propose to add the date in the extension.
project.202003-182325-FCBak
or
project.FCBak-202003-182325

to find always the name before the first .


Regards
Post Reply