How do you detect if a file is already open?

Can the "if(f)" file object be used to check if a file is already open? Looking for an example; would be appreciated; as I have been unable to find an example using "if(f)" file object.

William

Yes and no,

if f is the only file pointer to the file than it can be done the way you proposed.
If there are more file pointers in the sketch you should check them all.