diff --git a/TODO b/TODO
index 983d2917b..a79c03aca 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,3 @@
--- camput file
doesn't work when contains a symlink?
-
-- Go 1: convert all the fuse code & camlistore.org/pkg/fs to use rsc/fuse
(get cammount and webdav working again)
diff --git a/cmd/camput/camput.go b/cmd/camput/camput.go
index e23081383..8ae34b9c8 100644
--- a/cmd/camput/camput.go
+++ b/cmd/camput/camput.go
@@ -200,6 +200,19 @@ func (up *Uploader) UploadFile(filename string, rollSplits bool) (respr *client.
m := schema.NewCommonFileMap(filename, fi)
mode := fi.Mode()
switch {
+ case mode&os.ModeSymlink != 0:
+ if err = schema.PopulateSymlinkMap(m, filename); err != nil {
+ return nil, err
+ }
+ case mode&os.ModeDevice != 0:
+ // including mode & os.ModeCharDevice
+ fallthrough
+ case mode&os.ModeSocket != 0:
+ fallthrough
+ case mode&os.ModeNamedPipe != 0: // FIFO
+ fallthrough
+ default:
+ return nil, schema.ErrUnimplemented
case !fi.IsDir():
m["camliType"] = "file"
@@ -234,10 +247,6 @@ func (up *Uploader) UploadFile(filename string, rollSplits bool) (respr *client.
pr := &client.PutResult{BlobRef: blobref, Size: int64(len(json)), Skipped: false}
return pr, nil
}
- case mode&os.ModeSymlink != 0:
- if err = schema.PopulateSymlinkMap(m, filename); err != nil {
- return nil, err
- }
case fi.IsDir():
ss := new(schema.StaticSet)
dir, err := os.Open(filename)
@@ -310,15 +319,6 @@ func (up *Uploader) UploadFile(filename string, rollSplits bool) (respr *client.
return nil, err
}
schema.PopulateDirectoryMap(m, sspr.BlobRef)
- case mode&os.ModeDevice != 0:
- // including mode & os.ModeCharDevice
- fallthrough
- case mode&os.ModeSocket != 0:
- fallthrough
- case mode&os.ModeNamedPipe != 0: // FIFO
- fallthrough
- default:
- return nil, schema.ErrUnimplemented
}
mappr, err := up.UploadMap(m)