It is currently Sat Nov 25, 2017 2:58 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: PureBasic.prefs safety
PostPosted: Mon Oct 16, 2017 6:22 am 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 889
Location: Ukraine
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)

_________________
Time beyond time

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic.prefs safety
PostPosted: Mon Oct 16, 2017 7:48 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 378
Location: Berlin and Ibiza
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

_________________
ImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic.prefs safety
PostPosted: Mon Oct 16, 2017 11:24 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 696
Location: Cuernavaca, Mexico
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)


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.)

Code:
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic.prefs safety
PostPosted: Mon Oct 16, 2017 11:42 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1027
Lunasole wrote:
Store current prefs in a session DB or something like this

Do you know the Prefs dialog has its own backup and restore feature?


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic.prefs safety
PostPosted: Mon Oct 16, 2017 7:33 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 889
Location: Ukraine
@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

_________________
Time beyond time

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye