Commit dc293c4e authored by Steve Dutcher's avatar Steve Dutcher
Browse files

bug fixes

parent 12e73def
......@@ -62,14 +62,14 @@ p = Popen(["./sftper", "--url", "sftp://localhost"],
Sending commands:
```
import json, os, struct
dat = json.dumps({"command": "LISTDIR", "args":{"path", "/path"}}).encode()
p.stdin.write(struct.pack('!I', len(dat), dat))
dat = json.dumps({"command": "LISTDIR", "args":{"path": "/path"}}).encode()
p.stdin.write(struct.pack('!I', len(dat)) + dat)
```
Receiving results in Python
```
import json, os, struct
num = struct.unpack('!I', p.stdout.read(4))
num = struct.unpack('!I', p.stdout.read(4))[0]
dat = p.stdout.read(num)
assert len(dat) == num
zult = json.loads(dat)
......
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