Commit fb90bab
committed
fix: simplify file timestamp attribute handling
1. Removed fallback to ctime when checking file timestamps (btime/mtime/
atime)
2. Simplified ternary operations to directly use the respective
timestamp values
3. Fixed a duplicate semicolon in file initialization code
The changes streamline the file timestamp attribute handling by removing
redundant fallback checks to ctime. The original implementation would
fall back to ctime if the primary timestamp was 0, but this behavior
was unnecessary and could cause confusion. The timestamps are now
directly read from their respective fields (btime, mtime, atime) without
fallback.
Influence:
1. Verify file creation/modification/access timestamps are correctly
reported
2. Test with files that have valid timestamps in all fields
3. Check behavior with files that might have 0 values in timestamp
fields
4. Verify no regression in file information display functionality
fix: 简化文件时间戳属性处理
1. 移除了检查文件时间戳(btime/mtime/atime)时回退到ctime的处理
2. 简化了三元运算符,直接使用相应时间戳值
3. 修复了文件初始化代码中的重复分号问题
这些更改通过移除对ctime的冗余回退检查简化了文件时间戳属性处理。原实现会
在主时间戳为0时回退到ctime,但这种行为是不必要的且可能导致混淆。现在时间
戳直接从各自字段(btime, mtime, atime)读取而无需回退。
Influence:
1. 验证文件创建/修改/访问时间戳是否正确显示
2. 测试具有所有字段有效时间戳的文件
3. 检查时间戳字段为0时的处理行为
4. 验证文件信息显示功能没有退化
Fixes: #3657191 parent 8187238 commit fb90bab
1 file changed
Lines changed: 8 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
304 | 305 | | |
305 | 306 | | |
306 | 307 | | |
307 | | - | |
308 | | - | |
309 | | - | |
| 308 | + | |
310 | 309 | | |
311 | 310 | | |
312 | 311 | | |
| |||
325 | 324 | | |
326 | 325 | | |
327 | 326 | | |
328 | | - | |
329 | | - | |
330 | | - | |
| 327 | + | |
331 | 328 | | |
332 | 329 | | |
333 | 330 | | |
| |||
346 | 343 | | |
347 | 344 | | |
348 | 345 | | |
349 | | - | |
350 | | - | |
351 | | - | |
| 346 | + | |
352 | 347 | | |
353 | 348 | | |
354 | 349 | | |
| |||
367 | 362 | | |
368 | 363 | | |
369 | 364 | | |
370 | | - | |
371 | | - | |
372 | | - | |
| 365 | + | |
373 | 366 | | |
374 | 367 | | |
375 | 368 | | |
| |||
388 | 381 | | |
389 | 382 | | |
390 | 383 | | |
391 | | - | |
392 | | - | |
393 | | - | |
| 384 | + | |
394 | 385 | | |
395 | 386 | | |
396 | 387 | | |
| |||
409 | 400 | | |
410 | 401 | | |
411 | 402 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 403 | + | |
415 | 404 | | |
416 | 405 | | |
417 | 406 | | |
| |||
0 commit comments