Just a short story: PB config with all those precious settings was damaged on Purebasic.exe process termination, then it was overwritten after I restarted IDE.
I had no any actual backups of that file. Fortunately WinHex helped to find 3 traces of it in HDD empty space, 2 of them looking actual, so it seems I'll restore my config ^^
(btw Winhex for that is better than most of specialized data recovery programs showing you big fancy button).
Don't know if anyone else lost config in similar conditions (BSOD, power off, process terminated, IDE crash, solar storm, meteorite fall, nuclear attack, ..), but would be nice to have protection against that. Store current prefs in a session DB or something like this.
PS. As well as for other .prefs (especially templates)
PureBasic.prefs safety
PureBasic.prefs safety
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
- RSBasic
- Moderator
- Posts: 1218
- Joined: Thu Dec 31, 2009 11:05 pm
- Location: Gernsbach (Germany)
- Contact:
Re: PureBasic.prefs safety
You can remove the write permission for normal user.
Only programs with administrator rights can modify this file.
Or you use the checkbox "Read-only" in file properties.
Or you use a realtime backup software with file versioning, e.g.: http://www.purebasic.fr/german/viewtopi ... 11&t=29256
Only programs with administrator rights can modify this file.
Or you use the checkbox "Read-only" in file properties.
Or you use a realtime backup software with file versioning, e.g.: http://www.purebasic.fr/german/viewtopi ... 11&t=29256
Re: PureBasic.prefs safety
Yes, it has happened to my Main PureBasic pref file.. to combat this I created a small template that I use regularly to store the information in another directory. (especially if I've added procedures to my template file, or changed colors, etc.)Lunasole wrote: Don't know if anyone else lost config in similar conditions (BSOD, power off, process terminated, IDE crash, solar storm, meteorite fall, nuclear attack, ..), but would be nice to have protection against that. Store current prefs in a session DB or something like this.
PS. As well as for other .prefs (especially templates)
Code: Select all
If CopyDirectory("C:\Users\Bob H\AppData\Roaming\PureBasic", "C:\Latest Home\PureBasic\Bobs Template Backup Folder", "", #PB_FileSystem_Recursive|#PB_FileSystem_Force)
Debug "Success! You now have a copy of your template files!"
Else
Debug "+++++++++++++++++++++++++++"
Debug "+++++++++++++++++++++++++++"
Debug " Something went wrong! Please try again!"
Debug "+++++++++++++++++++++++++++"
Debug "+++++++++++++++++++++++++++"
EndIf
- It was too lonely at the top.
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Re: PureBasic.prefs safety
Do you know the Prefs dialog has its own backup and restore feature?Lunasole wrote:Store current prefs in a session DB or something like this
Re: PureBasic.prefs safety
@Dude
It's manual import/export, no any difference with just copying your AppData\Roaming\PureBasic folder
@RSBasic, @blueb
Obvious variants, but just workarounds.
At my first issue with templates (happened long-long ago) I already though to make some launcher (or other stuff) which will do auto-backups and probably finally will code such soon, cause today I really disliked perspective to recreate all the config ^^
In the end all is OK, thanks to NTFS trashing and Winhex, and thanks random it was not a templates file irreversible damage.
Anyway the point is to have such protection internally (like that cool code history feature which saved me lot of times. periodically files added to DB, with dialog to access recorded data from IDE).
I think that's good idea which is easy to implement and which for sure will save some PB coder's mental health in future, lol
It's manual import/export, no any difference with just copying your AppData\Roaming\PureBasic folder
@RSBasic, @blueb
Obvious variants, but just workarounds.
At my first issue with templates (happened long-long ago) I already though to make some launcher (or other stuff) which will do auto-backups and probably finally will code such soon, cause today I really disliked perspective to recreate all the config ^^
In the end all is OK, thanks to NTFS trashing and Winhex, and thanks random it was not a templates file irreversible damage.
Anyway the point is to have such protection internally (like that cool code history feature which saved me lot of times. periodically files added to DB, with dialog to access recorded data from IDE).
I think that's good idea which is easy to implement and which for sure will save some PB coder's mental health in future, lol
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"