diff options
Diffstat (limited to 'src/unstable/myriadfs.cpp')
-rw-r--r-- | src/unstable/myriadfs.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/unstable/myriadfs.cpp b/src/unstable/myriadfs.cpp index e02620d..b24997a 100644 --- a/src/unstable/myriadfs.cpp +++ b/src/unstable/myriadfs.cpp | |||
@@ -476,17 +476,32 @@ Bu::MyriadFs::Dir Bu::MyriadFs::readDir( int32_t iNode ) | |||
476 | 476 | ||
477 | Bu::MyriadStream is = mStore.openStream( 2 ); | 477 | Bu::MyriadStream is = mStore.openStream( 2 ); |
478 | Dir lDir; | 478 | Dir lDir; |
479 | // sio << "Reading dir, " << iNumChildren << " entries:" << sio.nl; | 479 | sio << "Reading dir " << iNode << ", " << iNumChildren << " entries:" << sio.nl; |
480 | for( int32_t j = 0; j < iNumChildren; j++ ) | 480 | for( int32_t j = 0; j < iNumChildren; j++ ) |
481 | { | 481 | { |
482 | int32_t iChildNode; | 482 | int32_t iChildNode = 0; |
483 | ms.read( &iChildNode, 4 ); | 483 | if( ms.read( &iChildNode, 4 ) < 4 ) |
484 | { | ||
485 | throw Bu::MyriadFsException( | ||
486 | "Failed to read iChildNode from directory."); | ||
487 | } | ||
488 | Bu::println(" - iNode = %1").arg( iChildNode ); | ||
484 | Stat s; | 489 | Stat s; |
485 | stat( iChildNode, s, is ); | 490 | stat( iChildNode, s, is ); |
486 | uint8_t uLen; | 491 | uint8_t uLen; |
487 | ms.read( &uLen, 1 ); | 492 | if( ms.read( &uLen, 1 ) < 1 ) |
493 | { | ||
494 | throw Bu::MyriadFsException( | ||
495 | "Failed to read uLen from directory."); | ||
496 | } | ||
497 | Bu::println(" - Name bytes = %1").arg( uLen ); | ||
488 | s.sName.setSize( uLen ); | 498 | s.sName.setSize( uLen ); |
489 | ms.read( s.sName.getStr(), uLen ); | 499 | if( ms.read( s.sName.getStr(), uLen ) < uLen ) |
500 | { | ||
501 | throw Bu::MyriadFsException( | ||
502 | "Failed to read sName from directory."); | ||
503 | } | ||
504 | Bu::println(" - Name = \"%1\"").arg( s.sName ); | ||
490 | lDir.append( s ); | 505 | lDir.append( s ); |
491 | 506 | ||
492 | // sio << " " << s.sName << sio.nl; | 507 | // sio << " " << s.sName << sio.nl; |
@@ -504,6 +519,8 @@ Bu::MyriadStream Bu::MyriadFs::openByInode( int32_t iNode ) | |||
504 | case typeDir: | 519 | case typeDir: |
505 | case typeSymLink: | 520 | case typeSymLink: |
506 | case typeRegFile: | 521 | case typeRegFile: |
522 | Bu::println("Opening stream by iNode=%1, myriad stream=%2") | ||
523 | .arg( iNode ).arg( rs.uStreamIndex ); | ||
507 | return mStore.openStream( rs.uStreamIndex ); | 524 | return mStore.openStream( rs.uStreamIndex ); |
508 | 525 | ||
509 | default: | 526 | default: |