file-locked-p

file-locked-p is a built-in function in `C source code'.

(file-locked-p FILENAME)

Return a value indicating whether FILENAME is locked.
The value is nil if the FILENAME is not locked,
t if it is locked by you, else a string saying which user has locked it.