Fix: use AppDomain.BaseDirectory and fix timestamp hh→HH in SimulatorMainTask#35
Open
HashidaTKS wants to merge 1 commit intomasterfrom
Open
Fix: use AppDomain.BaseDirectory and fix timestamp hh→HH in SimulatorMainTask#35HashidaTKS wants to merge 1 commit intomasterfrom
HashidaTKS wants to merge 1 commit intomasterfrom
Conversation
…mat hh→HH
Two bugs in GetResultFilePaths:
1. Path.Combine(".", ...) depends on the process working directory, which
can vary by launch method. Use AppDomain.CurrentDomain.BaseDirectory to
always resolve paths relative to the application's executable location.
2. The timestamp format "yyyyMMddhhmmss" used lowercase hh (12-hour clock,
01-12), which can produce duplicate file names for times that are 12 hours
apart (e.g. 09:00 AM and 09:00 PM both produce "09"). Change to uppercase
HH (24-hour clock, 00-23) to ensure unique timestamps.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
問題点
SimulatorMainTask.GetResultFilePaths()に2つのバグがあった。1. 相対パス
"."の使用(line 80)Path.Combine(".", "SimulationResult", ...)はプロセスの作業ディレクトリに依存するため、アプリケーションの起動方法によって保存先が変わる。2. タイムスタンプの
hh(12時間制)使用(line 76)DateTime.Now.ToString("yyyyMMddhhmmss")のhhは12時間表記(01〜12)のため、午前9時と午後9時が同じ文字列09になり、ファイル名が重複する可能性があった。改善内容
Path.Combine(".", ...)→Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ...)に変更"yyyyMMddhhmmss"→"yyyyMMddHHmmss"に変更(HH= 24時間制 00〜23)Test plan
🤖 Generated with Claude Code