From dfd72c64836f7e2b3153f6c77885cdef800eb093 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 18 Feb 2009 23:13:42 -0700 Subject: [PATCH] crawler: use fileutil.move_info_place in preference to our own version --- src/allmydata/storage/crawler.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/allmydata/storage/crawler.py b/src/allmydata/storage/crawler.py index e79ba94d..e4f8622c 100644 --- a/src/allmydata/storage/crawler.py +++ b/src/allmydata/storage/crawler.py @@ -1,8 +1,9 @@ -import sys, os, time, struct, pickle +import os, time, struct, pickle from twisted.internet import reactor from twisted.application import service from allmydata.storage.server import si_b2a +from allmydata.util import fileutil class TimeSliceExceeded(Exception): pass @@ -89,10 +90,7 @@ class ShareCrawler(service.MultiService): f = open(tmpfile, "wb") pickle.dump(state, f) f.close() - if "win32" in sys.platform.lower(): - # sigh, stupid windows can't use this technique - os.unlink(self.statefile) - os.rename(tmpfile, self.statefile) + fileutil.move_into_place(tmpfile, self.statefile) def startService(self): self.load_state() -- 2.45.2