fuser -c <directoryname> outputs the pid of the process that did cd to
the directory
fuser -f <filename> will give out the pid that opened the file.

If there is no process that opened the file, you will just see the filename
and no pid.
for test do this:
open a terminal
vi a file to edit
open another terminal
run fuser -f filename
you should see the pid of the process that is running vi.

]# lsof <dir> | grep -v bash | sed -n '2p' | awk '{ print $2 }' | xargs ps
PID TTY STAT TIME COMMAND
3890 pts/2 S+ 0:00 vi signal.shstatus.shtest_case_N.sh
#
this will get you which files under <dir> are opened and by what this
files are used, in my case I have opened files *.sh under <dir> with vi.