LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
LinkBack Search this Thread
Old 12-03-2007, 01:47 AM   #1
devkpict
Member
 
Registered: Oct 2007
Posts: 31

Rep: Reputation: 15
Thumbs up 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.
 
Old 12-03-2007, 04:24 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 7,514
Blog Entries: 1

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
Hi,

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.
 
Old 12-03-2007, 11:36 PM   #3
devkpict
Member
 
Registered: Oct 2007
Posts: 31

Original Poster
Rep: Reputation: 15
Can we find what gets executed at Filesystem

Quote:
Originally Posted by druuna View Post
Hi,

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
 
Old 12-04-2007, 07:54 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 7,514
Blog Entries: 1

Rep: Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139Reputation: 1139
Hi,

Quote:
Originally Posted by devkpict View Post
Thanks a lot,
You're welcome.

Quote:
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.

Hope this helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System calls/functions to execute a file within a program psandeepnair1985 Programming 1 05-02-2007 02:37 AM
poepn or system function call executed by a background process kshkid Programming 1 08-24-2006 03:04 AM
how do you use system calls? slinky2004 General 1 12-22-2005 09:39 PM
Some system calls Spooky Programming 1 11-24-2004 10:17 AM
System Calls file Hady Programming 1 12-13-2003 12:14 PM


All times are GMT -5. The time now is 12:33 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration