NO

Author Topic: Writing zeros to source files  (Read 2139 times)

aj

  • Guest
Writing zeros to source files
« on: June 02, 2009, 12:15:39 am »
I've encountered a problem now a couple of times - though I'm not exactly sure that it's directly related to Pelles C - it's annoying enough for me to post a bug report.


I'm wondering if Pelles C somehow overwrites source files with zeros before saving them.
Probably in Pelles C's handling of unsaved files when making an "unnatural" exit request, by creating the file and then SetFilePointer to the wanted size, and last write the actual data (which fails).

I've been developing a full screen application using FFmpeg, which crashed (due to a simple, stupid mistake involving two event-loops), causing the screen to get black and me to doing a hard reboot.
When I opened the project again the file I edited last was overwritten with zeroes. It's approximately (probably exactly) the same size as before - just that it's filled with zeros instead of the actual source. This gets kind of annoying when dealing with 10KiB source files...

The problem has also occured while developing a kernel module messing with the file system (also resulting in a hard reboot) - though then I blamed it all on the kernel module. This time I can't really blame that.

Hope you can help before the 6.00 version of this awsome IDE gets out of the gates!

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1902
Re: Writing zeros to source files
« Reply #1 on: June 02, 2009, 07:01:44 am »
That problem is Windows OS MemoryMapped file handling in crash situation.
May the source be with you

aj

  • Guest
Re: Writing zeros to source files
« Reply #2 on: June 02, 2009, 10:30:41 pm »
Oh, I see!

Then it's not directly related to Pelles C, in a way..