From: John Hodge Date: Tue, 28 Aug 2012 01:31:51 +0000 (+0800) Subject: DiskTool - Added basic flag dump to 'ls' X-Git-Tag: rel0.15~706^2~25 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=7757dcecbe3dee7b152d19501f281563627dadba;p=tpg%2Facess2.git DiskTool - Added basic flag dump to 'ls' --- diff --git a/Tools/DiskTool/src/actions.c b/Tools/DiskTool/src/actions.c index 074aab99..5cda5885 100644 --- a/Tools/DiskTool/src/actions.c +++ b/Tools/DiskTool/src/actions.c @@ -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); diff --git a/Tools/DiskTool/src/logging.c b/Tools/DiskTool/src/logging.c index 07d7a522..0cb3ed32 100644 --- a/Tools/DiskTool/src/logging.c +++ b/Tools/DiskTool/src/logging.c @@ -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");