#5744 HIGH Update.: "Resuming" a large file from USB copies it into NAND (filling NAND)
Zarro Boogs per Child
bugtracker at laptop.org
Fri Jan 4 09:50:03 EST 2008
#5744: "Resuming" a large file from USB copies it into NAND (filling NAND)
------------------------+---------------------------------------------------
Reporter: gnu | Owner: tomeu
Type: defect | Status: new
Priority: high | Milestone: Update.2
Component: datastore | Version: Build 653
Resolution: | Keywords: relnote
Verified: 0 | Blocking:
Blockedby: |
------------------------+---------------------------------------------------
Comment(by tomeu):
Simple patch for doing a symlink instead of a copy:
{{{
diff --git a/src/olpc/datastore/backingstore.py
b/src/olpc/datastore/backingstore.py
index e900649..1af0088 100644
--- a/src/olpc/datastore/backingstore.py
+++ b/src/olpc/datastore/backingstore.py
@@ -410,14 +410,13 @@ class FileBackingStore(BackingStore):
if e.errno != errno.EPERM:
raise
- # Try to link from the original file to the targetpath. This can
fail if
- # the file is in a different filesystem. Do a copy instead.
+ # Try to hardlink from the original file to the targetpath. This
can
+ # fail if the file is in a different filesystem. Do a symlink
instead.
try:
os.link(path, targetpath)
except OSError, e:
if e.errno == errno.EXDEV:
- shutil.copy(path, targetpath)
- os.chmod(targetpath, 0604)
+ os.symlink(path, targetpath)
else:
raise
}}}
Anybody sees any problem with this approach?
--
Ticket URL: <http://dev.laptop.org/ticket/5744#comment:18>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system
More information about the Bugs
mailing list