From 3f731cab480a1ee15c138c9b80f9438c9af754bd Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 07 Jan 2008 17:29:11 +0000 Subject: #5744: Don't copy files out from usb sticks, do a symlink instead. --- 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 hard link 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 -- cgit v0.9.1