NO

Author Topic: Backup copy  (Read 4145 times)

Tulehti

  • Guest
Backup copy
« on: October 26, 2006, 02:38:02 AM »
I started my little hobby project and all went well in little time.
About couple of days ago. IDE start to complain that The file 'samegame.c' has a backup copy from a previous session:
c:\path\to\temp\samegame.c
Do you want replace the file with backup copy?
[yes][no]

When i press no it's pop ups error message box Error reading from file 'samegame.c' Access is denied. If i press yes the same message will be appear. Some times it will open source code file and file has read only flag turned on.

So i removed all pelles generated files from source directory ppj etc, and generated project again. No help. Then i remove all the files from temp directory and remove all pelles generated files to project directory and generated project again. No help. Then i uninstalled Pelles C and reinstalled it. No din't help. I don't have any more ideas.  ](*,)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Backup copy
« Reply #1 on: October 26, 2006, 11:04:41 AM »
Try this:
Remove PellesC compiler.
Open registry editor, and remove the key with all its subkey:
Code: [Select]
[HKEY_CURRENT_USER\Software\Pelle Orinius]
Then reinstall pellesC.
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Tulehti

  • Guest
Backup copy
« Reply #2 on: October 26, 2006, 11:53:43 PM »
Didn't help.

RichieL

  • Guest
Re: Backup copy
« Reply #3 on: April 06, 2007, 10:26:08 PM »
I believe I know what causes this: POIDE has a problem with read-only source files. Check to see if the source file causing the problem has the read-only attribute, and remove the attribute. Then go to the directory

      C:\Documents and Settings\<your user name>\Local Settings\Temp

and delete the Pelles C backup file (it will have your source file name and extension folowed by another extension with a letter and a random string of digits). The problem should go away "forever" - until you have another read-only source file...

The following sequence illustrates the problem with POIDE:

1) Open a new project, call it A
2) Create a source file in that project and save it
3) Switch to some other project (project B)
4) Go into Windows Explorer and set the source file to read-only
5) Switch back to project A. The source file will come up in the source window as expected.
6) Switch back to project B. POIDE apparently tries to do something to the file at this point and hits the
    fact that it is read-only, which causes POIDE to not delete the backup copy.
7) Switch back to project A - voila, you get the pop-up screen and the refusal to load the file into the source
    window.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Backup copy
« Reply #4 on: April 10, 2007, 04:32:05 PM »
Is seems that the CopyFile API function also copies all file attributes. I'm sure it's all very useful, but not so much in this case. The backup copy will have the read-only attribute set, and the IDE is unable to delete this file when done.
/Pelle