Ros wrote: > There are 10 files in the folder. I wish to process all the files one > by one. But if the files are open or some processing is going on them > then I do not want to disturb that process. In that case I would > ignore processing that particular file and move to next file. > > How can I check whether the file is open or not? > > I tried os.stat and os.access but I am not getting the expected > results. > Also I checked in IO exceptions, IO error handler doesnt raise any > error if the file is open. > There are some options to check but they are platform dependent (works > only with unix)
You can't do that, at least not in a platform agnostic way, and usually not without cooperation of the file-modifying processes. Diez -- http://mail.python.org/mailman/listinfo/python-list