in hfs/hfslib.c [598:648]
void displayFolder(HFSCatalogNodeID folderID, Volume* volume) {
CatalogRecordList* list;
CatalogRecordList* theList;
HFSPlusCatalogFolder* folder;
HFSPlusCatalogFile* file;
time_t fileTime;
struct tm *date;
HFSPlusDecmpfs* compressData;
size_t attrSize;
theList = list = getFolderContents(folderID, volume);
while(list != NULL) {
if(list->record->recordType == kHFSPlusFolderRecord) {
folder = (HFSPlusCatalogFolder*)list->record;
printf("%06o ", folder->permissions.fileMode);
printf("%3d ", folder->permissions.ownerID);
printf("%3d ", folder->permissions.groupID);
printf("%12d ", folder->valence);
fileTime = APPLE_TO_UNIX_TIME(folder->contentModDate);
} else if(list->record->recordType == kHFSPlusFileRecord) {
file = (HFSPlusCatalogFile*)list->record;
printf("%06o ", file->permissions.fileMode);
printf("%3d ", file->permissions.ownerID);
printf("%3d ", file->permissions.groupID);
if(file->permissions.ownerFlags & UF_COMPRESSED) {
attrSize = getAttribute(volume, file->fileID, "com.apple.decmpfs", (uint8_t**)(&compressData));
flipHFSPlusDecmpfs(compressData);
printf("%12" PRId64 " ", compressData->size);
free(compressData);
} else {
printf("%12" PRId64 " ", file->dataFork.logicalSize);
}
fileTime = APPLE_TO_UNIX_TIME(file->contentModDate);
}
date = localtime(&fileTime);
if(date != NULL) {
printf("%2d/%2d/%4d %02d:%02d ", date->tm_mon, date->tm_mday, date->tm_year + 1900, date->tm_hour, date->tm_min);
} else {
printf(" ");
}
printUnicode(&list->name);
printf("\n");
list = list->next;
}
releaseCatalogRecordList(theList);
}