fuser not showing file open by vi

hi,

I opened a simple text file by vi. I then started another shell, and did fuser myFile. I expected it to show the pid of the vi session that had that file open, but it just returned a blank.

why would this be?

thanks

have you tried as "root" user also?

no. Not as root.

The funny thing is, if I do

fuser -cu /

then I can see a whole bunch of processed, one of which is my vi with my file open.

But I don;t want that.

I want to do

fuser myFile.ksh

as I only want to see if myFile.ksh is open. Am I missing something here?

thanks

===============================================

Hey,

Try to use following..

MYPATH="/clocal/user/dir1/dir2/"
for file_dir in `find $MYPATH -amin -1`
do

    echo \`fuser -uf "$file_dir" \` >> temp.txt.$$
    echo " $file_dir is  being accessed" >> temp.txt.$$

done

or

fuser -uf /dir1/dir2/file1

It perfectly works. and it shows the name of the user, who has accessed the file.
Catch : fuser returns a process id !! Below command stores the process id, thats being returned by fuser command.

var_pid = `fuser -uf "$file_dir"`

Hope this'll help you.

Thanks
Varun:b:

:b:

-------------------------------------------
hey,

for more help you can visit my post under the same forum:
"awk and fuction (recursion) !! Urgent !! "

Definetly this'll help you out !!
Thanks
Varun.