Create backup file when writing new xml file?

Thiago Macieira thiago at
Sun Feb 16 17:35:57 UTC 2014

Em dom 16 fev 2014, às 14:21:58, Dirk Hohndel escreveu:
> > Also, I know Windows also has issues with strncasecmp (that I use to
> > test that the backup really only gets written if the filename is
> > called ".xml") under msvc, but I really don't know if anybody really
> > builds it that way. So I just added a comment. A
> > "-Dstrncasecmp=_strnicmp" in the MSVC-specific build file might be
> > sufficient. Or maybe there is some Qt helper. Whatever.
> >
> > 
> >
> > As mentioned, I don't even know if this is really the direction we
> > want to go in.
> I will take the patch as is and ask the Windows expert (Lubomir) and the
> Qt export (Thiago) to see if there is something we should do
> differently.

Uh... I realise that the question might be about string comparisons. Since 
we're talking about filenames here, it actually bears the question of what the 
filesystem driver on OS X and on Windows consider to be the same. Do they 
restrict to ASCII? Do they apply to the full Unicode range? How about the 
Turkish dotless i?

Sorry, I don't have a ready answer for you. I hate case-insensitive filenames.

Instead, I'd recommend that save_backup not take as a parameter the 
recommended extension. Simply remove the part after the ending dot, whatever 
it might be, and replace it with .bak.

Thiago Macieira - thiago (AT) - thiago (AT)
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

More information about the subsurface mailing list