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:35:33 (GMT) |
commit | 64b7f75a69f7d3dabc2acd752677af791498ba35 (patch) | |
tree | 20031235874f0e94e78c00707949bcc1017d5d49 | |
parent | 449135d1f6cb9771b7837567771e4c6ad11e8968 (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 |