How is png file changes in paint written on the hdd platter?

Oblivion77

Distinguished
Jul 6, 2018
286
2
18,685
Hello everyone

I would like to now, how changes in a png file is written on the hdd platter, when you use paint.

If I make a file, open the file, make a change and save. Is the whole file written again (the whole picture you have drawn), or is it only the changes to the file that is written?
Does the head only write the changes in bytes? Or does the head write all the bytes again?

For example:
Original file: 00001111 00001111 00001111
Changed file: 00001111 00001111 00000000

When I press save, does it write all three bytes again, or does it only write the third and last byte?

Lets say I have drawn a monkey and press save as. I then open the file, draws a banana in the monkeys hand and press save. Does the head then write the monkey and banana on the platter, or does it only write the banana?

When I open a file, the system makes a buffer of the file, when I make a change and save, does the buffer then replace the original file or only the changes made?

Secondly, if I open a png file in paint, doesn't change anything, but still press save, does the buffer replace and overwrite the orginal file?

Hope it makes sende

Thanks alot in advance!

Best regards

Emil
 
I have always thought, that the modified date ONLY changes when an actual change was made and then press "save".
I just tried out, opened file, did NOT make any changes, only pressed "save" and the modified date changed.

1.
Has it always been like that?
2.
Would you say the original is written again or overwritten?

 


This depends a LOT on the application you use to open a png.
And that application is....?
 


I just tried a SAVE .png with MS Paint, and it does indeed change the Modified Date.
As is expected.
Creation date stays the same.

I did not do a pixel by pixel comparison, to see if anything else changed.
The metadata, being part or the file, means that the "file" is also changed, and rewritten on the disk.