[BUG] The temporary file name is longer than the target file name

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

@jovial-liu ci sta già lavorando.

Dal 8/10/2026.

  • #240 di @cpruijsen — chiusa senza merge
  • #242 di @jovial-liu — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
tooling

Direzione di ricerca

Start by locating where the library constructs the temporary filename, then reproduce the issue with a target filename one character below the filesystem limit. Done means the temporary filename is no longer longer than the target and the long-name case avoids ENAMETOOLONG.

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

Descrizione

Bug

What / Why

This library creates a temp file by appending some hash to the target file name. This is bad because when the target file name is really long (but still inside the filesystem limit) the temp file name might get out of that limit and a ENAMETOOLONG error will happen

We started to have this issue in pnpm v5, where we have really long file names in the content-addressable storage.
Related issue: https://github.com/pnpm/pnpm/issues/2605

How

Current Behavior

The temp file name is the <target file>.<hash>

Steps to Reproduce

Write a file that has a name 1 character shorter than the accepted limit.

Expected Behavior

The temp file name is short or at least not longer than the target file name.

References

https://github.com/pnpm/pnpm/issues/2605

Lingua principale
JavaScript
Stelle
256
Fork
51
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 npm/write-file-atomic

Tutte le issue di npm/write-file-atomic

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.