How does gedit edit and save a large file before the file is loaded?

I only needed to edit the first line of a 4MB file. When I open files large in gedit, it takes a minute or two to download the file, but it displays and lets you edit the part that it has downloaded so far. So I opened the file, quickly edited the first line, saved the file, and closed gedit before it even got close to finishing downloading the file.

How was he able to save the file before it was fully downloaded? The only way I know to edit files is to load it into memory, edit the copy in memory, and then write the whole thing to a file.

0


source to share


1 answer


4MB is not very big. It really shouldn't take a minute or two to download it. It might be loading the whole thing into memory, but then it takes a while to get around it to display the whole thing - the UI widgets can take a while. (Not a minute for a 4MB file, I hope, but ...)



Perhaps this allows you to edit the start and save it quickly - it finished loading the file but didn't finish displaying it.

+4


source







All Articles