From 26bb069c535e3fd5b0e0fb28fb54a2a540b60a84 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 18 Feb 2011 17:41:24 +0000 Subject: Some Uuid tweaks, not much, just figuring out the format. MyriadFs is coming along quite nicely. It looks like it works great for normal programs, but there need to be some tweaks made to a few things before it's working 100% via fuse. Also, the fuse module won't let you specify a file, a little odd. --- src/tests/myriadfs.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/tests/myriadfs.cpp') diff --git a/src/tests/myriadfs.cpp b/src/tests/myriadfs.cpp index fd96c02..5946b27 100644 --- a/src/tests/myriadfs.cpp +++ b/src/tests/myriadfs.cpp @@ -8,19 +8,41 @@ using namespace Bu; int main( int argc, char *argv[] ) { - Bu::MemBuf mb; +// Bu::MemBuf mb; + Bu::File mb("store.myr", File::Read|File::Write|File::Create ); Bu::MyriadFs mfs( mb, 512 ); + sio << "Creating dirs..." << sio.nl; + mfs.create("/etc", Bu::MyriadFs::typeDir|0755 ); + mfs.create("/dev", Bu::MyriadFs::typeDir|0755 ); + mfs.create("/usr", Bu::MyriadFs::typeDir|0755 ); + + mfs.create("/dev/null", Bu::MyriadFs::typeChrDev|0666, 1, 3 ); + mfs.create("/dev/zero", Bu::MyriadFs::typeChrDev|0666, 1, 5 ); + mfs.create("/dev/sda", Bu::MyriadFs::typeBlkDev|0660, 8, 0 ); + + sio << "Creating files..." << sio.nl; { Bu::MyriadStream ms = mfs.open("/hello", Bu::MyriadFs::Read ); ms.write("world!"); } + { + Bu::MyriadStream ms = mfs.open("/etc/hello", Bu::MyriadFs::Read ); + ms.write("world, again!"); + } + sio << "Reading files..." << sio.nl; { Bu::MyriadStream ms = mfs.open("/hello", Bu::MyriadFs::Read ); char buf[512]; buf[ms.read( buf, 512 )] = '\0'; sio << "read: '" << buf << "'" << sio.nl; } + { + Bu::MyriadStream ms = mfs.open("/etc/hello", Bu::MyriadFs::Read ); + char buf[512]; + buf[ms.read( buf, 512 )] = '\0'; + sio << "read: '" << buf << "'" << sio.nl; + } } -- cgit v1.2.3