find: -printf %A@ and %T@ reject timestamps before 1970
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 30/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
%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.
- Lingua principale
- Rust
- Stelle
- 657
- Fork
- 115
- Merge medio
- 1g 9h
- PR unite (30g)
- 31
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di uutils/findutils
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
uutils/findutils#692 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
find on Windows: opt in to / as the path separatorForse già presa @mutewinter l’ha presa 24 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
I maintainer di solito rispondono entro 1 giorno
-
xargs: -x runs a pending command before rejecting an oversized argumentForse già presa @SichenLiang l’ha presa 26 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 28/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di uutils/findutils
Issue simili
-
needs-triage tooling
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
neilsh/stunt-reel#317 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
storytold/craft-fonts#65 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
storytold/craft-libs#723 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
n0-computer/iroh#4669 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno