[Windows CMD] Cannot write multiple values/only change one value in a file, when not writing to a temporary file first
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 領域
- cli
調査の方向性
示されている initool set と get コマンドを使用し、filename.ini に対して出力をそのファイルへリダイレクトして、問題を再現します。set の CLI エントリポイントから開始し、出力が stdout に書き込まれる流れを追跡します。コマンドのリダイレクトによって元のすべてのセクションとキーが保持され、要求された値だけが変更されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
(Not a duplicate of #11.)
Do you have to pipe the output to temporary files? Does it not work to overwrite the same file?
e.g.
C:\> initool get filename.ini
[section1]
abc=xyz
[section2]
foo=bar
C:\> initool set filename.ini section1 abc zyx
[section1]
abc=zyx
[section2]
foo=bar
C:\> initool set filename.ini section1 abc zyx > filename.ini
C:\ initool get filename.ini
[section1]
abc=zyx
C:\>
In the above example, I use set to change the value of one key, and then pipe that output back to the original filepath. Although the stdout of set shows all the keys of the original file with just the one key that has changed (this is expected), when it is piped back to the filepath, it overwrites the entire file with just the modified line, deleting all other lines (this is bad).
It's not the end of the world to write the output to a temp file and back, but it's an extra step that seems like it shouldn't be necessary. I'm more concerned by the fact that the stdout from the set command doesn't get written accurately when piped to a file.
- 主要言語
- Standard ML
- スター
- 77
- フォーク
- 7
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dbohdan/initool のほかの issue
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
dbohdan/initool の issue をすべて見る
似ている issue
-
難易度 2/5 1時間未満 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
5hyuns/maya-workflow-kit-for-blender#568 ·
メンテナーはふだん 1 日以内に返信
-
bug follow-up lane:backlog
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Sanne/incus-spawn#2620 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
builtins good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
good first issue new package
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
wimpysworld/deb-get#2158 ·
メンテナーはふだん 7 日以内に返信