find: -printf %A@ and %T@ reject timestamps before 1970

Đang mở
#927 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@zhangpan2001 đang làm issue này rồi.

Từ ngày 27/10/2026.

  • #928 của @zhangpan2001 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
cli

Hướng nghiên cứu

The issue points to src/find/matchers/printf.rs, where TimeFormat::SinceEpoch calls duration_since(UNIX_EPOCH)?. Read that implementation and inspect nearby tests for %A@ and %T@; reproduce with the issue’s pre-1970 example. Done means -printf and -fprintf print negative epoch seconds, including fractional timestamps, without the error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

%A@ and %T@ should print negative epoch seconds for files whose access or modification time is before 1970. Current main instead reports an error and stops rendering the format for that file, while still exiting 0.

From the repository root after building:

uu_find="$PWD/target/debug/find"
tmp=$(mktemp -d)
(
    cd "$tmp" || exit
    touch -a -m -d '1969-12-31 23:59:59 UTC' file
    LC_ALL=C /usr/bin/find file -printf '%A@|%T@\n'
    LC_ALL=C "$uu_find" file -printf '%A@|%T@\n'
)

GNU findutils 4.11.0 prints:

-1.0000000000|-1.0000000000

uutils prints no stdout and reports:

Error processing 'file': second time provided was later than self

Both exit 0. The same problem occurs with -fprintf, and fractional timestamps before the epoch also fail. Timestamps at or after the epoch work.

TimeFormat::SinceEpoch uses duration_since(UNIX_EPOCH)?, which rejects negative offsets. This is separate from #914, which fixes pre-1970 comparisons for -newerXt.

Tested with uutils findutils 0.11.0, main 82cfc21f0d45fc654588f0f4243e9c6e5f57fc97, on Debian forky/sid, Linux x86_64, against /usr/bin/find from GNU findutils 4.11.0.

Ngôn ngữ chính
Rust
Star
657
Fork
115
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
31

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của uutils/findutils

Tất cả issue của uutils/findutils

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.