summaryrefslogtreecommitdiff
path: root/src/tests/myriadfs.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-02-18 17:41:24 +0000
committerMike Buland <eichlan@xagasoft.com>2011-02-18 17:41:24 +0000
commit26bb069c535e3fd5b0e0fb28fb54a2a540b60a84 (patch)
tree9eab7637e5fa1d881c775a6f0611b74e385196f1 /src/tests/myriadfs.cpp
parent80c8dd155a164c186fd11e3e3f66e8f3cfdf19fe (diff)
downloadlibbu++-26bb069c535e3fd5b0e0fb28fb54a2a540b60a84.tar.gz
libbu++-26bb069c535e3fd5b0e0fb28fb54a2a540b60a84.tar.bz2
libbu++-26bb069c535e3fd5b0e0fb28fb54a2a540b60a84.tar.xz
libbu++-26bb069c535e3fd5b0e0fb28fb54a2a540b60a84.zip
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.
Diffstat (limited to 'src/tests/myriadfs.cpp')
-rw-r--r--src/tests/myriadfs.cpp24
1 files changed, 23 insertions, 1 deletions
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;
8 8
9int main( int argc, char *argv[] ) 9int main( int argc, char *argv[] )
10{ 10{
11 Bu::MemBuf mb; 11// Bu::MemBuf mb;
12 Bu::File mb("store.myr", File::Read|File::Write|File::Create );
12 Bu::MyriadFs mfs( mb, 512 ); 13 Bu::MyriadFs mfs( mb, 512 );
13 14
15 sio << "Creating dirs..." << sio.nl;
16 mfs.create("/etc", Bu::MyriadFs::typeDir|0755 );
17 mfs.create("/dev", Bu::MyriadFs::typeDir|0755 );
18 mfs.create("/usr", Bu::MyriadFs::typeDir|0755 );
19
20 mfs.create("/dev/null", Bu::MyriadFs::typeChrDev|0666, 1, 3 );
21 mfs.create("/dev/zero", Bu::MyriadFs::typeChrDev|0666, 1, 5 );
22 mfs.create("/dev/sda", Bu::MyriadFs::typeBlkDev|0660, 8, 0 );
23
24 sio << "Creating files..." << sio.nl;
14 { 25 {
15 Bu::MyriadStream ms = mfs.open("/hello", Bu::MyriadFs::Read ); 26 Bu::MyriadStream ms = mfs.open("/hello", Bu::MyriadFs::Read );
16 ms.write("world!"); 27 ms.write("world!");
17 } 28 }
29 {
30 Bu::MyriadStream ms = mfs.open("/etc/hello", Bu::MyriadFs::Read );
31 ms.write("world, again!");
32 }
18 33
34 sio << "Reading files..." << sio.nl;
19 { 35 {
20 Bu::MyriadStream ms = mfs.open("/hello", Bu::MyriadFs::Read ); 36 Bu::MyriadStream ms = mfs.open("/hello", Bu::MyriadFs::Read );
21 char buf[512]; 37 char buf[512];
22 buf[ms.read( buf, 512 )] = '\0'; 38 buf[ms.read( buf, 512 )] = '\0';
23 sio << "read: '" << buf << "'" << sio.nl; 39 sio << "read: '" << buf << "'" << sio.nl;
24 } 40 }
41 {
42 Bu::MyriadStream ms = mfs.open("/etc/hello", Bu::MyriadFs::Read );
43 char buf[512];
44 buf[ms.read( buf, 512 )] = '\0';
45 sio << "read: '" << buf << "'" << sio.nl;
46 }
25} 47}
26 48