Author Topic: cb-crash-recover folder  (Read 9012 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
cb-crash-recover folder
« on: August 28, 2006, 10:49:02 am »
the description in the crash-dialog says:
"The application encountered a crash at address %u.\n\n"
"A snapshot of the present state of Code::Blocks has been saved to the directory cb-crash-recover inside your 'My Files' folder.
Hopefully, this will prevent you from losing recent modifications.\n\n"


but in reality a new user-folder is created (at least) on Windoze-systems in the system "Document and Settings" folder

Code
LONG WINAPI CrashHandlerFunc(PEXCEPTION_POINTERS ExceptionInfo)
{
    ...
    wxString path(ConfigManager::GetHomeFolder() + _T("cb-crash-recover"));
    wxMkdir(ConfigManager::GetHomeFolder() + _T("cb-crash-recover"));
    path << _T("/");
    ...
}

e.g. my system

Username = Cad
then ConfigManager::GetHomeFolder() returns "C:\Dokumente und Einstellungen\Cad"
(without Backslash at the end)

and the files are backed up to "C:\Dokumente und Einstellungen\Cadcb-crash-recover"

following the description in the crash-dialog it should be backed up to
"C:\Dokumente und Einstellungen\Cad\Eigene Dateien\cb-crash-revover"

is this what was intended originally ?
otherwise the explanantion in the crash-dialog should be updated accordingly.

thx
tiwag

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: cb-crash-recover folder
« Reply #1 on: August 28, 2006, 11:23:14 am »
Yes, it was a bug. Fixed now.
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: cb-crash-recover folder
« Reply #2 on: August 28, 2006, 11:31:27 am »
its is better but not fixed

at least under Windoze it is NOT backuped to the folder where the description says ...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: cb-crash-recover folder
« Reply #3 on: August 28, 2006, 11:55:20 am »
Quote
Eigene Dateien

I don't know what that is :) (only suspect "Application Data").
Anyway, I just added the missing slash. Thomas knows which folder to save into is correct though, so let's wait for him to fix this (either by changing the message, or the dest folder).
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: cb-crash-recover folder
« Reply #4 on: August 28, 2006, 12:05:50 pm »
Quote
Eigene Dateien
this is the german translation for "my files", i thought it would be obvious in the cited context ...

I don't know what that is :) (only suspect "Application Data").
Anyway, I just added the missing slash. Thomas knows which folder to save into is correct though, so let's wait for him to fix this (either by changing the message, or the dest folder).

the "Application Data" folder would be the best location i think

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: cb-crash-recover folder
« Reply #5 on: August 28, 2006, 02:35:43 pm »
The intent is to save everything to a subfolder of "My Files" ( == "Eigene Dateien") and that's what happens on my Windows system, too (at least it did so when I last tested it ~2 months ago, and since disabling CC, I have no crashes, so I cannot tell of late ;)).

"Application Data" is not a good place to save it IMO because it is not application data, it is user data. :)

Will look into it pronto. :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: cb-crash-recover folder
« Reply #6 on: August 28, 2006, 02:56:23 pm »
Since that line in the crash handler never changed, it must be GetHomeFolder() which now returns a pathname without trailing slash, while returning a trailing slash before. Strange enough, I cannot find the revision in which this happened (must be a couple of months back).

Anyway, Yiannis' fix seems to do the job. It won't work on Windows 95/98, but the crash handler doesn't work there anyway (no SEH available), so it is not a problem.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: cb-crash-recover folder
« Reply #7 on: August 28, 2006, 10:01:22 pm »
The intent is to save everything to a subfolder of "My Files" ( == "Eigene Dateien") and that's what happens on my Windows system, too (at least it did so when I last tested it ~2 months ago, and since disabling CC, I have no crashes, so I cannot tell of late ;)).
you don't need a crash to test, what GetHomeFolder() returns,
and i tell you the truth when i say it does not return the path to "My Files" (at the time of writing svn rev 2914)
it returns the base path of the user account, see AND READ my first posting above.

it does not care in which directory the damned files are saved, but the message in the dialog
should name the right directory.
therefore i propose, to print in the dialog message the variable, which already contains
the path to the backup directory.

i'll do the changes if this is agreed by the bosses ...

tiwag
« Last Edit: August 28, 2006, 10:18:30 pm by tiwag »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: cb-crash-recover folder
« Reply #8 on: August 28, 2006, 10:59:58 pm »
for me it was also in : Docsuments and settings\killerbotcb-crash-recover so when the slash would be inserted it would be a subdir of the top level of my profile (killerbot), which is not something like "My Files" ;-)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: cb-crash-recover folder
« Reply #9 on: August 28, 2006, 11:20:43 pm »
for me it was also in : Docsuments and settings\killerbotcb-crash-recover so when the slash would be inserted it would be a subdir of the top level of my profile (killerbot), which is not something like "My Files" ;-)
This is "My Files"...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

takeshimiya

  • Guest
Re: cb-crash-recover folder
« Reply #10 on: August 28, 2006, 11:42:55 pm »
=/