Re: urgent question, about filesystem-files

2008-04-10 Thread Rick King
Could you first find out if it exists with isfile(..) and then try to open it? If it fails I *think* it would have to be open by another process. -Rick King Southfield MI bvidinli wrote: i started python programming a few months ago. now i need the code to understand if a file already o

Re: urgent question, about filesystem-files

2008-04-10 Thread bvidinli
* i do not want to prevent other process access same file, i only want if a file being used as i acess it. * i am not interested if a process will access same file just after i access it... because in my case, this is not possible.. * i want some other way, other than linux lsof command. it is s

Re: urgent question, about filesystem-files

2008-04-10 Thread Robert.Spilleboudt
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. >

Re: urgent question, about filesystem-files

2008-04-10 Thread Diez B. Roggisch
bvidinli wrote: > this is for ensuring that file is not in use, ... > by any process  in system How do you prevent the other processes that *might* access that file from doing so while *you* work on it? unless they cooperate using file-locks, you might end up with garbage. Diez -- http://ma

Re: urgent question, about filesystem-files

2008-04-10 Thread bvidinli
The need/reason for this, i write a program that should perform some operation on files, only if the file is not being used this is for ensuring that file is not in use, ... by any process in system 10.04.2008 tarihinde bvidinli <[EMAIL PROTECTED]> yazmış: > Sory for lack of information

Fwd: urgent question, about filesystem-files

2008-04-10 Thread bvidinli
Sory for lack of information, i use linux/unix i need to solve this for linux/unix i tested os.open with O_EXCL flag, and some other things, that did not solve. i need exacly: say example file testfile, check if testfile already open by some other process in linux, tahnks. 2008/4/10, G

Re: urgent question, about filesystem-files

2008-04-10 Thread Gerhard Häring
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. >

Re: urgent question, about filesystem-files

2008-04-10 Thread Gabriel Genellina
En Thu, 10 Apr 2008 05:11:09 -0300, bvidinli <[EMAIL PROTECTED]> escribió: > 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 n

Re: urgent question, about filesystem-files

2008-04-10 Thread Gary Herron
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

urgent question, about filesystem-files

2008-04-10 Thread bvidinli
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 "