urgent question, about filesystem-files

Robert.Spilleboudt robert.spilleboudt.no.sp.am at skynet.be
Thu Apr 10 06:12:38 EDT 2008


bvidinli wrote:
> i started python programming a few months ago.
> 
> now i need the code to understand if a file already opened in
> filesystem by another process ?
> 
> i looked at docs, howtos, but did not find related info.
> note that normal file open/write operations in python, i know it.
> 
> i specificly need to know that "is a file already open by some other
> process other than python".
> 
> 
> Thank you in advance
This is a OS function. With Linux you use the command lsof (as root). A 
Python program can call such a command, but you have to parse the output.
Robert



More information about the Python-list mailing list