#4796 NORM Never A: Cannot copy files from an usb stick into main journal

Zarro Boogs per Child bugtracker at laptop.org
Sat Nov 10 09:39:26 EST 2007


#4796: Cannot copy files from an usb stick into main journal
-----------------------+----------------------------------------------------
 Reporter:  tomeu      |       Owner:  tomeu         
     Type:  defect     |      Status:  new           
 Priority:  normal     |   Milestone:  Never Assigned
Component:  datastore  |     Version:                
 Keywords:  update.1?  |    Verified:  0             
-----------------------+----------------------------------------------------
 Fix is easy:

 {{{
 diff --git a/src/olpc/datastore/backingstore.py
 b/src/olpc/datastore/backingstore.py
 index 4445e40..c9ef05a 100644
 --- a/src/olpc/datastore/backingstore.py
 +++ b/src/olpc/datastore/backingstore.py
 @@ -395,7 +395,16 @@ class FileBackingStore(BackingStore):

              targetpath = "%s(%s)%s" % (targetpath, attempt, ext)

 -        os.chmod(path, 0604)
 +        # Try to make the original file readable. This can fail if the
 file is
 +        # in FAT filesystem.
 +        try:
 +            os.chmod(path, 0604)
 +        except OSError, e:
 +            if e.errno != errno.EPERM:
 +                raise
 +
 +        # Try to link from the original file to the targetpath. This can
 work if
 +        # the file is in a different filesystem. Do a copy instead.
          try:
              os.link(path, targetpath)
          except OSError, e:
 }}}

-- 
Ticket URL: <http://dev.laptop.org/ticket/4796>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list