March 01, 2009 11:41 AM
To: undisclosed-recipients:
Subject: Re: file locking...
On Sun, 1 Mar 2009 10:00:54 -0800, "bruce"
declaimed the following in comp.lang.python:
>
> Except in my situation.. the client has no knowledge of the filenaming
> situation, and i might have 1000s
Hi Bruce,
you can do it like Maildir [1] you move (os.rename()) file or directories.
Maybe something like this: You have three directories: "todo", "in-process" and
"done".
A process tries to os.rename from todo to in-process. If it fails, some other
process has done it before. If the process is
In message , bruce
wrote:
> my concern about a "gatekeeper" wasn't so much related to performance, as
> the possibility of race conditions...
Which is what the gatekeeper will prevent. It serializes the granting of
locks, and that means no race conditions.
--
http://mail.python.org/mailman/li
python-list-bounces+bedouglas=earthlink@python.org
[mailto:python-list-bounces+bedouglas=earthlink@python.org]on Behalf
Of Lawrence D'Oliveiro
Sent: Monday, March 02, 2009 12:29 AM
To: python-list@python.org
Subject: RE: file locking...
In message , bruce
wrote:
> using any kind of file lo
In message , bruce
wrote:
> using any kind of file locking process requires that i essentially have a
> gatekeeper, allowing a single process to enter, access the files at a
> time...
The gatekeeper doesn't need to do any more than ensure that any particular
filename is only locked by a maximum
In message , Nigel
Rantor wrote:
> In other words, why would you rely on a scheme that limits some
> processes to certain parts of the data?
That could be part of the original requirements, it's not clear from the
description so far.
--
http://mail.python.org/mailman/listinfo/python-list
zugnush wrote:
You could do something like this so that every process will know if
the file "belongs" to it without prior coordination, it means a lot
of redundant hashing though.
In [36]: import md5
In [37]: pool = 11
In [38]: process = 5
In [39]: [f for f in glob.glob('*') if int(md5.md5(
You could do something like this so that every process will know if
the file "belongs" to it without prior coordination, it means a lot
of redundant hashing though.
In [36]: import md5
In [37]: pool = 11
In [38]: process = 5
In [39]: [f for f in glob.glob('*') if int(md5.md5(f).hexdigest(),16
En Sun, 01 Mar 2009 16:11:41 -0200, Nigel Rantor
escribió:
bruce wrote:
i can easily setup a file read/write lock process where a client app
gets/locks a file, and then copies/moves the required files from the
initial
dir to a tmp dir. after the move/copy, the lock is released, and the
c
l Message-
From: python-list-bounces+bedouglas=earthlink@python.org
[mailto:python-list-bounces+bedouglas=earthlink@python.org]on Behalf
Of Nigel Rantor
Sent: Sunday, March 01, 2009 2:00 AM
To: koranthala
Cc: python-list@python.org
Subject: Re: file locking...
koranthala wrote:
On Mar 1, 2:
.org]on Behalf
Of Gabriel Genellina
Sent: Sunday, March 01, 2009 9:50 AM
To: python-list@python.org
Subject: Re: file locking...
En Sun, 01 Mar 2009 15:39:56 -0200, bruce
escribió:
> the issue that i'm looking at is analogous to a FIFO, where i have lots
> of
> files being shoved in a dir
En Sun, 01 Mar 2009 15:39:56 -0200, bruce
escribió:
the issue that i'm looking at is analogous to a FIFO, where i have lots
of
files being shoved in a dir from different processes.. on the other end,
i
want to allow mutiple client processes to access unique groups of these
files as fast a
@python.org]on Behalf
Of Nigel Rantor
Sent: Sunday, March 01, 2009 2:00 AM
To: koranthala
Cc: python-list@python.org
Subject: Re: file locking...
koranthala wrote:
> On Mar 1, 2:28 pm, Nigel Rantor wrote:
>> bruce wrote:
>>> Hi.
>>> Got a bit of a question/is
-list-bounces+bedouglas=earthlink@python.org
[mailto:python-list-bounces+bedouglas=earthlink@python.org]on Behalf
Of MRAB
Sent: Sunday, March 01, 2009 8:04 AM
To: python-list@python.org
Subject: Re: file locking...
bruce wrote:
> Hi.
>
> Got a bit of a question/issue that I'
bruce wrote:
Hi.
Got a bit of a question/issue that I'm trying to resolve. I'm asking this of
a few groups so bear with me.
I'm considering a situation where I have multiple processes running, and
each process is going to access a number of files in a dir. Each process
accesses a unique group o
koranthala wrote:
On Mar 1, 2:28 pm, Nigel Rantor wrote:
bruce wrote:
Hi.
Got a bit of a question/issue that I'm trying to resolve. I'm asking
this of a few groups so bear with me.
I'm considering a situation where I have multiple processes running,
and each process is going to access a number
On Mar 1, 2:28 pm, Nigel Rantor wrote:
> bruce wrote:
> > Hi.
>
> > Got a bit of a question/issue that I'm trying to resolve. I'm asking
> > this of a few groups so bear with me.
>
> > I'm considering a situation where I have multiple processes running,
> > and each process is going to access a nu
bruce wrote:
Hi.
Got a bit of a question/issue that I'm trying to resolve. I'm asking
this of a few groups so bear with me.
I'm considering a situation where I have multiple processes running,
and each process is going to access a number of files in a dir. Each
process accesses a unique group o
On Jul 15, 11:38 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> Sparky wrote:
> > Hello! I am writing some software that will have many users accessing
> > the same file resource at once for reading purposes only. I am
> > programming on (Ubuntu) Linux and my question is in Windows, can I
> > have it
Sparky wrote:
Hello! I am writing some software that will have many users accessing
the same file resource at once for reading purposes only. I am
programming on (Ubuntu) Linux and my question is in Windows, can I
have it so that the same file can be open in read mode by more than
one person or c
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, Dr. Who wrote:
>
>
>>Please let me know if I'm missing something since they seem like
>>normal file operations that I would hope Python would abstract away.
>
>
> I don't think of them as "normal" operations. They are "extra" stuff that
In <[EMAIL PROTECTED]>, Dr. Who wrote:
> Please let me know if I'm missing something since they seem like
> normal file operations that I would hope Python would abstract away.
I don't think of them as "normal" operations. They are "extra" stuff that
is not only dependent on the operating system
Sure it will do if one of the processes needs read access only.
Scenario when you need shared rw acces with locking:
In the file you have "records" say 30 bytes long, 2 processes are
reading/writing these records by: lock-read-unlock or lock-write-unlock
. Both processes have to open the file with
Sure it will do if one of the processes needs read access only.
Scenario when you need shared rw acces with locking:
In the file you have "records" say 30 bytes long, 2 processes are
reading/writing these records by: lock-read-unlock or lock-write-unlock
. Both processes have to open the file with
Hi everybody:
I played with the class Flock and changed the line
win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE,\
to
win32con.FILE_SHARE_READ,\
and now I cannot copy the file over which suits me.
When file is NOT locked I get:
E:\>copy d:\log.txt .
Overwrite .\log.txt? (Yes/No/All): y
1
I just have written the program in "C", which does the same. It behaves
almost the way you described.
Tthe copy command gives such diagnostic:
The process cannot access the file because
another process has locked a portion of the file.
0 file(s) copied.
BUT THE FILE IS ACTUALLY OVERWRITTEN..
I'
I get
The process cannot access the file because another process has locked a
portion of the file.
0 file(s) copied.
on both Win2k and WinXP. (Python 2.4, Pywin32 build 203)
Are you sure the log.txt you're copying to is actually the right one ? You
should at least get a
prompt to confir
Pekka Niiranen wrote:
> Is there a way around this? How can I stop file being COPIED OVER while
> it is being open?
you could rename the file before you start updating it, and rename it back when
done.
--
http://mail.python.org/mailman/listinfo/python-list
Kamus of Kadizhar <[EMAIL PROTECTED]> wrote in message news:<[EMAIL
PROTECTED]>...
> Thanks to Robert Brewer, I got enough insight into logging to make it work
>
> Now I have another issue: file locking. Sorry if this is a very basic
> question, but I can't find a handy reference anywhere t
29 matches
Mail list logo