Experience says that most ASCII text editors (notepad, vi, microEmacs.
PFE etc) do not hold files open. Each load and save operation typically
opens the file, does what it needs to do and closes it again.
Many word processors, OTOH, seem to hold files open. I think Word falls
into this class but can't prove it.
But, why just speculate about this when you can easily try an
experiment. All you need is a simple CLI program whose logic is
something line:
open a file
write a prompt to the console
read the response to the prompt
close the file
exit
The program could have options to write or read the file. Its benefit is
that, unlike using some program with unknown characteristics, with this
you *KNOW* that the file is open once you've seen the prompt but haven't
yet responded to it. At this point you can run other commands or even
(shock, horror!) code that you think should check whether the file is in
use or not.
Running tests is the only safe way to go because actual behavior is
likely to be platform-specific. I'd guess that File.canRead() and
File.canWrite() may detect file locks under most Unices, MVS or
Guardian, because these OSen have kernel support for file locking, but
probably do not under Windows. I may be wrong here because I haven't
seriously programmed for that environment since Win 95: IIRC there is no
kernel level locking in Win 95 or its associated version of DOS.