[z3-checkins] r45141 - z3/sqlos/trunk/src/sqlos/file

kobold at codespeak.net kobold at codespeak.net
Mon Jul 16 23:54:20 CEST 2007


Author: kobold
Date: Mon Jul 16 23:54:20 2007
New Revision: 45141

Modified:
   z3/sqlos/trunk/src/sqlos/file/fsutility.py
Log:
Copy files instead of using links (otherwise, zope will freeze on NFS filesystems).


Modified: z3/sqlos/trunk/src/sqlos/file/fsutility.py
==============================================================================
--- z3/sqlos/trunk/src/sqlos/file/fsutility.py	(original)
+++ z3/sqlos/trunk/src/sqlos/file/fsutility.py	Mon Jul 16 23:54:20 2007
@@ -270,7 +270,7 @@
         fullfilename = os.path.join(self._calcFilePath(id), filename)
         # NOTE: Filesystem operation is thread safe as the thread id is a
         # component of the filename
-        os.link(fullfilename, tmpfile)
+        shutil.copyfile(fullfilename, tmpfile)
 
     def _getTmpFile(self, id):
         assert id in self._state
@@ -312,7 +312,7 @@
                 if os.path.exists(filedir):
                     shutil.rmtree(filedir)
                 os.makedirs(filedir)
-                os.link(tmpfile, fullfilename)
+                shutil.copyfile(tmpfile, fullfilename)
                 FS_USE_LOCK.release()
             self._delTmpFile(id)
         self._state = {}


More information about the z3-checkins mailing list