From: stephan b. <st...@s1...> - 2004-12-21 17:51:31
|
Am i understanding this properly? i want to implement a pio_ssh plugin. Looking at pio_file as a basis, it would appear that i need to do something like this: Implement IORequest_xxx_Ssh for each type. zB: class IORequest_xxx_Ssh ... { open(): - open an ssh pipe and tie it to my IOHandler. Command passed to ssh depends on type of IORequest: GET = 'ssh -C user@host "cat /path/to/file"' PUT = 'ssh -C user@host "cat > /path/to/file"' and so on... receive(buff,count): - read count bytes from my IOHandler. This is potentially bad if IOHandler blocks, of course. write(): - write data to my iohandler close(): - Send EOF to iohandler. (How? i can't write(0,0) to it, can i?) Delete the IOH? Does this object own it? That's not clear looking at the API. If the handler does not own it, is there any chance of changing IORequest(IOHandler*) to IORequest(IOHandler&), to make ownership obvious? }; ssh-based virtual filesystem :). KDE implements one using the 'fish' protocol and a clever perl script which gets uploaded to the remote side and acts as a translater between remote commands and the local ssh. Pretty clever stuff. i guess i could write a fish-compatible IORequest, instead, since that's an established protocol. Anyway - am i understanding the architecture properly? Are there any pitfalls i need to be aware of? -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |