[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rdiff-backup-users] More windows patches
From: |
Josh Nisly |
Subject: |
Re: [rdiff-backup-users] More windows patches |
Date: |
Mon, 14 Apr 2008 07:17:08 -0500 |
User-agent: |
Thunderbird 2.0.0.12 (X11/20080227) |
Andrew Ferguson wrote:
> On Apr 13, 2008, at 6:24 PM, Josh Nisly wrote:
os.kill is not available on Windows, so there's no way from Python to
determine whether a process is running, without using the PyWin32
package. (We check to make sure that another rdiff-backup process
isn't already running, so that we don't stomp on each other's data.)
The rdiff-backup-kill.patch simply ignores the check. So here is my
question: is it acceptable to import and use platform-specific
modules? We would obviously need to handle it correctly if they
weren't there. Seems like we do something similar for Mac OS X
specific functionality, but I wanted to check.
Yes, please use the PyWin32 package to implement the functionality. It
is very important that we make sure that only 1 rdiff-backup instance
is accessing a repository at a time.
As a general rule, the goal here is to have absolute parity between
the posix and nt platforms. In cases where nt truly does not support
it (eg, symlinks, hardlinks), it's ok for the feature to be dropped
(which you did in the appropriate place: fs_abilities.py). The
os.kill() case is like popen2() -- rdiff-backup should use the
Windows-specific code as necessary.
Attached is a patch that checks for an already running process. It uses
win32api to try to open the process. This is similar in principle to trying to
send a signal to the process, i.e. os.kill().
Thanks,
JoshN
rdiff-backup-kill.tar
Description: Unix tar archive