Commit 3c64a018 authored by Ivan Krasin's avatar Ivan Krasin

Fixed the problem: filename has 0x00 symbol at the end

parent 7e853ab4
......@@ -6,6 +6,7 @@ import (
"fmt"
"os"
"path"
"strings"
)
const (
......@@ -254,7 +255,7 @@ func readDir(fs FileSystem, h *InHeader, ing interface{}, c *managerClient) (int
}
func lookup(h *InHeader, r *bytes.Buffer, c *managerClient) (interface{}, Status) {
filename := string(r.Bytes())
filename := strings.TrimRight(string(r.Bytes()), "\x00")
fmt.Printf("filename: %s\n", filename)
resp := c.lookup(h.NodeId, filename)
if resp.status != OK {
......
......@@ -9,11 +9,11 @@ import (
)
const (
tempMountDir = "testMountDir"
tempMountDir = "testMountDir2"
)
var (
testFileNames = []string{"one", "two", "three3"}
testFileNames = []string{"one", "two", "three.txt"}
)
type testFuse struct{}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment