Changeset bf226890 in mainline for uspace/app/bdsh/cmds/modules/ls/ls.c
- Timestamp:
- 2009-01-22T15:40:18Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b7be230
- Parents:
- 4cc0c9ee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/ls/ls.c
r4cc0c9ee rbf226890 50 50 51 51 static char *cmdname = "ls"; 52 53 static inline uint64_t flen(const char *f) 54 { 55 int fd; 56 uint64_t size; 57 58 fd = open(f, O_RDONLY); 59 if (fd == -1) 60 return 0; 61 62 size = lseek(fd, 0, SEEK_END); 63 close(fd); 64 65 if (size < 0) 66 size = 0; 67 68 return size; 69 } 52 70 53 71 static unsigned int ls_scope(const char *path) … … 121 139 static void ls_print_dir(const char *d) 122 140 { 123 printf("%-40s\t< DIR>\n", d);141 printf("%-40s\t<dir>\n", d); 124 142 125 143 return; … … 128 146 static void ls_print_file(const char *f) 129 147 { 130 printf("%-40s\ n", f);148 printf("%-40s\t%u\n", f, flen(f)); 131 149 132 150 return;
Note:
See TracChangeset
for help on using the changeset viewer.