LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   file modification in linux (https://www.linuxquestions.org/questions/linux-newbie-8/file-modification-in-linux-330523/)

nov 06-05-2005 06:33 AM

file modification in linux
 
Hi

Can anyone please tell me how linux saves a file(one that was already saved and is changed now). Does it simply overwrite the entire file or only overwrite the part that was changed.

GlowGlow 06-05-2005 07:11 AM

That depends on how the file was opened. The open() system call depends accepts flags that determine how the file will be handled. Have a look at the open() manual page to see what flags are available:

man 2 open

The developer of an application could have decided to append to a file, change the file, or completely rewrite a file from a buffer.

nov 06-05-2005 07:20 AM

Thanks for the suggestion. But my question was what the linux kernel does when asked to save a file( for eg: a text document which was modified )

JunctaJuvant 06-05-2005 09:02 AM

Quote:

... my question was what the linux kernel does when asked to save a file ...
See File handling in the Linux kernel for a detailed complete description. According to the author you will need the following to understand:
Quote:

... a working knowledge of C, and an understanding of the general principles of operating system design.
Hope that helps.


All times are GMT -5. The time now is 11:20 AM.