How to tell if a file is opened on Linux and Windows?

I was wondering how to find out, programmatically, what files are opened by a certain process or if a file is opened by some process. After googling for a while and going through some Linux books, I've found the following references very useful to get a general idea:

Here are the solutions that I've found more promising. My target OS was Linux, so if you are looking for a Windows solution, I'd recommend you to look further on the Internet, though some tools listed here will apply to you.

How to tell if a file is opened?

How to tell what files has a process opened?