Given the name of a file, how can I determine if the file is currently opened or in-use? (I am talking about files rather than Perl file handles.)
Please note that I am looking for a general-purpose Perl solution rather than an operating system-specific one. At a minimum, I would like something that works both on Windows and GNU/Linux-based systems.
POSIX does not provide any way to do this. Therefore, no portable solution is possible given the current portable O/S interface available.
You’d have to craft some higher level approach that provides a single point of access for the opening bits. It’s like with lock files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With