Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

find on Windows: opt in to / as the path separator

Aperta
#906 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mutewinter ci sta già lavorando.

Dal 15/10/2026.

  • #907 di @mutewinter — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cli

Direzione di ricerca

A pull request (#907) is already open for this, so read it before anything else. The proposal reads the UUTILS_PATH_SEPARATOR variable on Windows only, next to UUTILS_DIAG, and affects path output in printing, -path/-regex, -printf and -exec. The docs go in docs/src/extensions.md. The name and shape are still open for maintainer decision, and the existing tests assert native separators through fix_up_slashes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

On Windows, find joins the paths it walks with \, so output mixes separators with whatever the start point used, and -path/-prune patterns written with / match nothing:

PS> find tree -not -path '*/.*'
tree
tree\.hidden
tree\.hidden\secret.txt
...
PS> find test_data/depth/1 -name f2
test_data/depth/1\2\f2

This is the expected native behavior (the tests assert it through fix_up_slashes), so I am not proposing to change the default. But MSYS2, Cygwin and Git Bash users, scripts written for POSIX shells, and tools that drive find from another program (our case: an agent shell whose paths are all /) need /. The same request exists for ls in uutils/coreutils#12742 and microsoft/coreutils#107, and ripgrep answers it with --path-separator.

Proposal: an environment variable, UUTILS_PATH_SEPARATOR=/, read only on Windows, in the same family as UUTILS_DIAG. With it set, every path a walk produces uses /: printing, -path/-wholename/-regex, -printf %p/%h/%P, and -exec {}. Any other value, or none, changes nothing. It should also accept slash: Git Bash and MSYS2 rewrite an environment value of a bare / into their install folder (C:/Program Files/Git/) before a native program sees it. A GNU-style option would collide with GNU's option space, which is why I lean to the variable. The same variable would serve uutils grep (uutils/grep, PR ready) and later ls.

I have a PR ready (about 40 lines plus tests and a section in docs/src/extensions.md), green on the Windows CI legs in my fork. Happy to change the name or the shape before opening it.

Lingua principale
Rust
Stelle
651
Fork
111
Merge medio
1g 13h
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di uutils/findutils

Tutte le issue di uutils/findutils

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.