diff options
author | Mike Buland <mike@xagasoft.com> | 2024-07-15 12:59:18 -0700 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2024-07-15 12:59:18 -0700 |
commit | 499cdaf05204a40d86e0e1b4dd32709b3ab67e20 (patch) | |
tree | 5fa31a6e4b4e2c3abde43b4e52ef3a88f6cab864 /src/unstable/myriadfs.cpp | |
parent | 4bf0f0c256693e30017f9bea60cf55aa97f8994a (diff) | |
download | libbu++-499cdaf05204a40d86e0e1b4dd32709b3ab67e20.tar.gz libbu++-499cdaf05204a40d86e0e1b4dd32709b3ab67e20.tar.bz2 libbu++-499cdaf05204a40d86e0e1b4dd32709b3ab67e20.tar.xz libbu++-499cdaf05204a40d86e0e1b4dd32709b3ab67e20.zip |
MyriadFs improvements and new helper tool.
I think the interface could be a lot better...but it does work and we
can use it examine and work with MyriadFs files.
Diffstat (limited to 'src/unstable/myriadfs.cpp')
-rw-r--r-- | src/unstable/myriadfs.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/unstable/myriadfs.cpp b/src/unstable/myriadfs.cpp index 919f8b9..e02620d 100644 --- a/src/unstable/myriadfs.cpp +++ b/src/unstable/myriadfs.cpp | |||
@@ -113,7 +113,7 @@ void Bu::MyriadFs::stat( const Bu::String &sPath, Bu::MyriadFs::Stat &rBuf ) | |||
113 | stat( iNode, rBuf, is ); | 113 | stat( iNode, rBuf, is ); |
114 | } | 114 | } |
115 | 115 | ||
116 | Bu::MyriadStream Bu::MyriadFs::open( const Bu::String &sPath, int /*iMode*/, | 116 | Bu::MyriadStream Bu::MyriadFs::open( const Bu::String &sPath, int iMode, |
117 | uint16_t uPerms ) | 117 | uint16_t uPerms ) |
118 | { | 118 | { |
119 | int32_t iParent = -1; | 119 | int32_t iParent = -1; |
@@ -123,7 +123,12 @@ Bu::MyriadStream Bu::MyriadFs::open( const Bu::String &sPath, int /*iMode*/, | |||
123 | iNode = lookupInode( sPath, iParent ); | 123 | iNode = lookupInode( sPath, iParent ); |
124 | // sio << "File found." << sio.nl; | 124 | // sio << "File found." << sio.nl; |
125 | // The file was found | 125 | // The file was found |
126 | return openByInode( iNode ); | 126 | Bu::MyriadStream ms = openByInode( iNode ); |
127 | if( (iMode&Truncate) ) | ||
128 | { | ||
129 | ms.setSize( 0 ); | ||
130 | } | ||
131 | return ms; | ||
127 | } | 132 | } |
128 | catch( Bu::MyriadFsException &e ) | 133 | catch( Bu::MyriadFsException &e ) |
129 | { | 134 | { |