how VI reads from a file ,what flow of system calls gets executed
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
how VI reads from a file ,what flow of system calls gets executed
While ,working with VI on my suse machine,I found that VI actually,
deletes the original file and creates all new file,with the same name,
both files have different inodes.
So iwant to figure out how he do it,What systemcalls get executed in the kernel.
You can use strace to follow what vi is doing. Something like: strace vi infile 2>strace.out. strace.out holds all the system calls and signals.
Depending on how vim is configured (we are talking about vim, not vi I hope) the infile is unlinked or moved. The latter happens when set backup and set bex=.bak are set in the vimrc file (local or global).
Hope this helps.
Last edited by druuna; 12-03-2007 at 08:50 AM.
Reason: Fixed a typo.
You can use strace to follow what vi is doing. Something like: strace vi infile 2>strace.out. strace.out holds all the system calls and signals.
Depending on how vim is configured (we are talking about vim, not vi I hope) the infile is unlinked or moved. The latter happens when set backup and set bex=.bak are set in the vimrc file (local or global).
Hope this helps.
Thanks a lot,
Can we find what calls get executed at filesystem level.
i.e ext3
Can we find what calls get executed at filesystem level.
i.e ext3
I don't think I understand the question. A 'normal' program doesn't (have to/ want to) know what FS it runs on, FS related stuff isn't taken care of by the 'normal' program.
You can however see in the strace output which files and dirs are called/written by vi.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.