From 499cdaf05204a40d86e0e1b4dd32709b3ab67e20 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 15 Jul 2024 12:59:18 -0700 Subject: 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. --- src/unstable/myriadfs.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/unstable/myriadfs.cpp') 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 ) stat( iNode, rBuf, is ); } -Bu::MyriadStream Bu::MyriadFs::open( const Bu::String &sPath, int /*iMode*/, +Bu::MyriadStream Bu::MyriadFs::open( const Bu::String &sPath, int iMode, uint16_t uPerms ) { int32_t iParent = -1; @@ -123,7 +123,12 @@ Bu::MyriadStream Bu::MyriadFs::open( const Bu::String &sPath, int /*iMode*/, iNode = lookupInode( sPath, iParent ); // sio << "File found." << sio.nl; // The file was found - return openByInode( iNode ); + Bu::MyriadStream ms = openByInode( iNode ); + if( (iMode&Truncate) ) + { + ms.setSize( 0 ); + } + return ms; } catch( Bu::MyriadFsException &e ) { -- cgit v1.2.3