| 235 | } |
| 236 | |
| 237 | void fileStat(const char* filename) |
| 238 | { |
| 239 | gdb_stat_t stat; |
| 240 | int res = gdb_syscall_stat(filename, &stat); |
| 241 | Serial << _F("gdb_syscall_stat(\"") << filename << _F("\") returned ") << res << endl; |
| 242 | if(res != 0) { |
| 243 | return; |
| 244 | } |
| 245 | |
| 246 | #define PRT(x) Serial << _F(" " #x " = ") << stat.x << endl |
| 247 | #define PRT_HEX(x) Serial << _F(" " #x " = 0x") << String(stat.x, HEX) << endl |
| 248 | #define PRT_TIME(x) Serial << _F(" " #x " = ") << DateTime(stat.x).toFullDateTimeString() << endl |
| 249 | |
| 250 | PRT(st_dev); |
| 251 | PRT(st_ino); |
| 252 | PRT_HEX(st_mode); |
| 253 | PRT(st_nlink); |
| 254 | PRT_HEX(st_uid); |
| 255 | PRT_HEX(st_gid); |
| 256 | PRT(st_rdev); |
| 257 | PRT(st_size); |
| 258 | PRT(st_blksize); |
| 259 | PRT(st_blocks); |
| 260 | PRT_TIME(st_atime); |
| 261 | PRT_TIME(st_mtime); |
| 262 | PRT_TIME(st_ctime); |
| 263 | #undef PRT |
| 264 | #undef PRT_HEX |
| 265 | #undef PRT_TIME |
| 266 | } |
| 267 | |
| 268 | /* |
| 269 | * Keep commands and their description together to ensure 'help' is consistent. |
no test coverage detected