Rev 3814 | Rev 3945 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3814 | Rev 3834 | ||
|---|---|---|---|
| Line 48... | Line 48... | ||
| 48 | #include "ls.h" |
48 | #include "ls.h" |
| 49 | #include "cmds.h" |
49 | #include "cmds.h" |
| 50 | 50 | ||
| 51 | static char *cmdname = "ls"; |
51 | static char *cmdname = "ls"; |
| 52 | 52 | ||
| 53 | static inline uint64_t flen(const char *f) |
53 | static inline off_t flen(const char *f) |
| 54 | { |
54 | { |
| 55 | int fd; |
55 | int fd; |
| 56 | uint64_t size; |
56 | off_t size; |
| 57 | 57 | ||
| 58 | fd = open(f, O_RDONLY); |
58 | fd = open(f, O_RDONLY); |
| 59 | if (fd == -1) |
59 | if (fd == -1) |
| 60 | return 0; |
60 | return 0; |
| 61 | 61 | ||
| Line 143... | Line 143... | ||
| 143 | return; |
143 | return; |
| 144 | } |
144 | } |
| 145 | 145 | ||
| 146 | static void ls_print_file(const char *f) |
146 | static void ls_print_file(const char *f) |
| 147 | { |
147 | { |
| 148 | printf("%-40s\t%u\n", f, flen(f)); |
148 | printf("%-40s\t%llu\n", f, (long long) flen(f)); |
| 149 | 149 | ||
| 150 | return; |
150 | return; |
| 151 | } |
151 | } |
| 152 | 152 | ||
| 153 | void help_cmd_ls(unsigned int level) |
153 | void help_cmd_ls(unsigned int level) |