Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fmt: stops at an unreadable file operand and says only 'read error' for a directory

オープン 初心者向け
#15,922 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@emirmrkaljevic がすでに取り組んでいます。

2026年10月27日 から。

  • #15923 @emirmrkaljevic による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
cli

調査の方向性

fmt の実装で、issue にファイルエラーがオペランドのループの外へ伝播すると記載されている箇所を確認するため、まず process_file と uumain を調べてください。その処理の流れを、GNU について説明されている動作と比較します。読み取れないオペランドごとに報告し、後続のファイルの処理を続け、全体として失敗ステータスを返します。issue の例である fmt d a.txt と fmt missing a.txt を使って再現してください。どちらのエラーの後にも a.txt がフォーマットされ、ディレクトリエラーに d が示されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

U - fmt

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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uutils/coreutils のほかの issue

uutils/coreutils の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。