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