Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update README on error handling.

  • Loading branch information...
commit 236f0afb109c6867b42f31c329ad274e74d2bc03 1 parent 6d39cd1
@hanwen authored
Showing with 7 additions and 1 deletion.
  1. +3 −0  README
  2. +4 −1 fs.go
View
3  README
@@ -15,3 +15,6 @@ Usage:
cp -a ~/Music/Some-Album xoom/Music/
fusermount -u xoom
+After a file is closed (eg. if "cp" completes), it is safe to unplug
+the device; the filesystem then will continue to function, but
+generates I/O errors when it reads from or writes to the device.
View
5 fs.go
@@ -125,7 +125,10 @@ func (n *fileNode) send() error {
log.Printf("Sending file %q to device: %d bytes.", n.file.Name(), fi.Size())
if n.file.Id() != 0 {
// Apparently, you can't overwrite things in MTP.
- n.fs.dev.DeleteObject(n.file.Id())
+ err := n.fs.dev.DeleteObject(n.file.Id())
+ if err != nil {
+ return err
+ }
}
n.file.SetFilesize(uint64(fi.Size()))
start := time.Now()
Please sign in to comment.
Something went wrong with that request. Please try again.