#5744 HIGH Update.: "Resuming" a large file from USB copies it into NAND (filling NAND)

Zarro Boogs per Child bugtracker at laptop.org
Wed Jan 2 10:50:52 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):

 This seems to make the trick. Any better idea?

 {{{
 diff --git a/src/olpc/datastore/backingstore.py
 b/src/olpc/datastore/backingstore.py
 index e900649..1083ba1 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:
              os.link(path, targetpath)
          except OSError, e:
              if e.errno == errno.EXDEV:
 -                shutil.copy(path, targetpath)
 -                os.chmod(targetpath, 0604)
 +                # The hard link failed because the file is in another
 file system.
 +                # Return the original file path instead of a link.
 +                targetpath = path
              else:
                  raise

 }}}

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



More information about the Bugs mailing list