DiskTool - Added basic flag dump to 'ls'
authorJohn Hodge <[email protected]>
Tue, 28 Aug 2012 01:31:51 +0000 (09:31 +0800)
committerJohn Hodge <[email protected]>
Tue, 28 Aug 2012 01:31:51 +0000 (09:31 +0800)
Tools/DiskTool/src/actions.c
Tools/DiskTool/src/logging.c

index 074aab9..5cda588 100644 (file)
@@ -141,7 +141,14 @@ int DiskTool_ListDirectory(const char *Directory)
        char    name[256];
        while( VFS_ReadDir(fd, name) )
        {
-               Log("- %s", name);
+               tFInfo  fi;
+               int child = VFS_OpenChild(fd, name, 0);
+               if( child != -1 )
+               {
+                       VFS_FInfo(child, &fi, 0);
+                       VFS_Close(child);
+               }
+               Log("- %02x %6lli %s", fi.flags, fi.size, name);
        }
        
        VFS_Close(fd);
index 07d7a52..0cb3ed3 100644 (file)
@@ -67,7 +67,7 @@ void Debug_HexDump(const char *Prefix, const void *Data, size_t Length)
        fprintf(stderr, "[HexDump ]d %s:", Prefix);
        for( ; ofs < Length; ofs ++ )
        {
-               if( ofs % 16 == 8 )     fprintf(stderr, " ");
+               if( ofs % 8 == 0 )      fprintf(stderr, " ");
                fprintf(stderr, " %02x", data[ofs%16]);
        }
        fprintf(stderr, "\n");

UCC git Repository :: git.ucc.asn.au