mirror of
https://github.com/parnic/advent-of-code-2022.git
synced 2025-06-16 13:40:13 -05:00
Fix Rider profiler on Windows
I don't know why, but in a Profiling run, File.Exists() returns true for a file that very much does not exist. Adding the directory check enables it to get the actually-correct answer. Another option is handling an exception in File.ReadLines, but I'm ok with this for now. This doesn't fix Rider's profiler on macos, though...on mac, it hangs forever thinking that input is redirected but not actually having anything in the buffer. I haven't found a fix for that yet.
This commit is contained in:
@ -46,6 +46,7 @@ public static class Parsing
|
|||||||
|
|
||||||
var filename = $"inputs/{inputName}.txt";
|
var filename = $"inputs/{inputName}.txt";
|
||||||
if (File.Exists(filename))
|
if (File.Exists(filename))
|
||||||
|
if (Directory.Exists(Path.GetDirectoryName(filename)!) && File.Exists(filename))
|
||||||
{
|
{
|
||||||
foreach (var line in File.ReadLines(filename))
|
foreach (var line in File.ReadLines(filename))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user