l29ah / Network-NineP

A library providing one with a somewhat higher level interface to 9P2000 protocol than existing implementations. Designed to facilitate rapid development of synthetic filesystems.
https://hackage.haskell.org/package/Network-NineP
Other
7 stars 2 forks source link

Sample Example? #1

Closed joe9 closed 8 years ago

joe9 commented 8 years ago

Hello,

Thanks for sharing Network-NineP.

Just want to check if you have any sample examples using it?

Thanks again,

l29ah commented 8 years ago

https://github.com/l29ah/Network-NineP/blob/master/Test.hs

l29ah commented 8 years ago

Also you can check out https://github.com/l29ah/hatexmpp3

joe9 commented 8 years ago

Hello,

Thanks for the samples. I am planning on writing a 9Pserver using Network-NineP. How do the clients (programmed in C) connect to it? Do they need to link or include these headers https://github.com/chaos/diod and make the calls listed in that library to read from the files provided by the 9PServer or do they just use the plain linux system read/write/open calls?

Thanks

l29ah commented 8 years ago

You can either make clients that talk 9P, or mount the filesystem in linux and use the usual syscalls. 9mount(1) is a nice suid program akin to pmount(1) that makes mounting 9P servers simpler.

joe9 commented 8 years ago

Hello,

When I try to mount it,

sudo mount -t 9p /tmp/h9pt /tmp/9pfs
mount: mount(2) failed: No such file or directory

smart_sudo lsmod | grep --colour=auto --ignore-case 9p
9p                     34512  0
9pnet_virtio            7261  0
virtio_ring             6787  1 9pnet_virtio
virtio                  5465  1 9pnet_virtio
9pnet                  59791  2 9p,9pnet_virtio

When I try with 9p:
/usr/lib/plan9/bin/9p read /tmp/h9pt
/usr/lib/plan9/bin/9p: mount: dial unix!/tmp/ns.joe.:0/: connect /tmp/ns.joe.:0/: Connection refused

Any suggestions on what I am missing, please?

Thanks

l29ah commented 8 years ago

On Wed, Oct 12, 2016 at 07:31:07PM -0700, joe9 wrote:

Hello,

When I try to mount it,

sudo mount -t 9p /tmp/h9pt /tmp/9pfs
mount: mount(2) failed: No such file or directory

smart_sudo lsmod | grep --colour=auto --ignore-case 9p
9p                     34512  0
9pnet_virtio            7261  0
virtio_ring             6787  1 9pnet_virtio
virtio                  5465  1 9pnet_virtio
9pnet                  59791  2 9p,9pnet_virtio

Any suggestions on what I am missing, please?

Anything interesting in dmesg?

() ascii ribbon campaign - against html mail /\ http://arc.pasp.de/ - against proprietary attachments

joe9 commented 8 years ago

9mount worked fine. I think the above mount command should be provided more options to work well.

Thanks

joe9 commented 8 years ago

@l29ah quick question, Instead of implementing the directory structure in the package, why not just use a library (FileSystem on MissingH.HVFS) for it? Just want to check if there was any reason for not taking that approach.

Thanks

joe9 commented 8 years ago

@l29ah sorry for bothering you about this. Could you please put the Data.NineP package also on github? It will be easier to raise issues, or pull requests.

l29ah commented 8 years ago

But it's there already: https://github.com/l29ah/9ph

l29ah commented 8 years ago

System.IO.HVFS is possible, but it will give a less usable/strict results as it doesn't provide a tree abstraction, i think.

joe9 commented 8 years ago

@l29ah The hackage description still points to the googelcode webpage https://hackage.haskell.org/package/NineP-0.0.2.1. Thanks.

l29ah commented 8 years ago

On Sat, Oct 15, 2016 at 06:45:18AM -0700, joe9 wrote:

@l29ah The hackage description still points to the googelcode webpage https://hackage.haskell.org/package/NineP-0.0.2.1. Thanks.

Thanks, will be updated at the next release.

() ascii ribbon campaign - against html mail /\ http://arc.pasp.de/ - against proprietary attachments