finding out the pid for a busy text file

Can some one please tell me how to find out the proccess ID that is holding up a file.

I am attempting to remove a file and I am getting a message stating that it is busy.

i.e

rm filename
filename: 777 mode ? (y/n) y
rm: filename not removed. Text file busy

Thanks in advance.

fuser may be able to do this. This public domain program lsof certainly can.

But the usual solution is to move the busy file out of the way. Something like...
mv /usr/local/bin/prog /usr/local/bin/prog.old
mv prog /usr/local/bin

And then later...
rm /usr/local/bin/prog.old