Boost logo

Boost Users :

Subject: [Boost-users] [filesystem] How to tell if a file is locked.
From: Andrew Maclean (andrew.amaclean_at_[hidden])
Date: 2009-02-26 18:07:56


Is it possible using boost::filesystem functions to determine if a
file is locked?
I have a program which scans a directory for files and I want it to
ignore locked files because other process are writing to them.

Basically I want to do the following:
get the file
if (is_locked())
   continue
else
  process the file

So I just want to know if it is locked. This must work for both Linux
and Windows Vista.

Has anyone any ideas or example code?

Thanks
   Andrew

-- 
___________________________________________
Andrew J. P. Maclean
Centre for Autonomous Systems
The Rose Street Building J04
The University of Sydney  2006  NSW
AUSTRALIA
Ph: +61 2 9351 3283
Fax: +61 2 9351 7474
URL: http://www.acfr.usyd.edu.au/
___________________________________________

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net