diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-01-07 17:29:11 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-01-07 17:29:11 (GMT) |
commit | 3f731cab480a1ee15c138c9b80f9438c9af754bd (patch) | |
tree | 4c9ff3a6bdfa9157f280e8cdad12043a7ada8f85 | |
parent | d9bf5f08e7390c31a2d813e84c52a440f0f2076c (diff) |
#5744: Don't copy files out from usb sticks, do a symlink instead.
-rw-r--r-- | src/olpc/datastore/backingstore.py | 7 |
1 files changed, 3 insertions, 4 deletions
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 |