fmt: stops at an unreadable file operand and says only 'read error' for a directory
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
fmt の実装で、issue にファイルエラーがオペランドのループの外へ伝播すると記載されている箇所を確認するため、まず process_file と uumain を調べてください。その処理の流れを、GNU について説明されている動作と比較します。読み取れないオペランドごとに報告し、後続のファイルの処理を続け、全体として失敗ステータスを返します。issue の例である fmt d a.txt と fmt missing a.txt を使って再現してください。どちらのエラーの後にも a.txt がフォーマットされ、ディレクトリエラーに d が示されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
fmt stops at the first file operand it can't read and never formats the files after it. GNU fmt reports the bad operand and goes on with the rest. For a directory operand uutils also prints a bare read error with no file name, where GNU says error reading 'dir': Is a directory.
Found with behave, comparing uutils fmt (main) with GNU coreutils 9.12.
$ mkdir d; printf 'one\ntwo\n' > a.txt
$ fmt d a.txt # GNU 9.12
fmt: error reading 'd': Is a directory
one two
$ echo $?
1
$ fmt d a.txt # uutils
fmt: read error
$ echo $?
1
$ fmt missing a.txt # GNU 9.12
fmt: cannot open 'missing' for reading: No such file or directory
one two
$ fmt missing a.txt # uutils
fmt: cannot open 'missing' for reading: No such file or directory
In uutils, process_file returns the open/metadata/directory error with ?, and uumain propagates it, so the loop over the files ends there. GNU's fmt_file prints the error, records the failure, and returns so main keeps going.
- 主要言語
- Rust
- スター
- 24.3k
- フォーク
- 2.1k
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 357
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
uutils/coreutils のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
B - high priority U - tr
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
U - df
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
U - mv
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
shuf: exhausted random source destroys the input during an in-place shuffle対応中かも @limadog9 が 2 日前に担当しました。 オープンU - shuf
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
uutils/coreutils の issue をすべて見る
似ている issue
-
bug dependencies kind:fix priority: P3 ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
shep-pm/shep#1318 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
swc-project/swc-next#1165 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
Alive24/shea-symphony#574 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信