changeset 235:e17bb8818318

tiffs ls: show read-only file flag
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 26 Jan 2014 18:17:03 +0000
parents 024042383a26
children 254de9560ef3
files ffstools/tiffs-rd/ls.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ffstools/tiffs-rd/ls.c	Sun Jan 26 11:47:13 2014 +0000
+++ b/ffstools/tiffs-rd/ls.c	Sun Jan 26 18:17:03 2014 +0000
@@ -43,18 +43,25 @@
 {
 	struct inode_info *inf = inode_info[ino];
 	u_long size;
+	char readonly;
 
+	if (inf->type & 0x10)
+		readonly = ' ';
+	else
+		readonly = 'r';
 	switch (inf->type) {
 	case 0xE1:
 	case 0xF1:
 		size = get_file_size(ino, 0);
-		printf("f %7lu %s\n", size, pathname);
+		printf("f%c %7lu %s\n", readonly, size, pathname);
 		return;
+	case 0xE2:
 	case 0xF2:
-		printf("d         %s\n", pathname);
+		printf("d%c         %s\n", readonly, pathname);
 		return;
+	case 0xE3:
 	case 0xF3:
-		printf("l         %s\n", pathname);
+		printf("l%c         %s\n", readonly, pathname);
 		return;
 	default:
 		fprintf(stderr,