Skip to content

FileNotFoundException when file name is given without extension #12

Description

@merfolk

Repro

Try to import valid CSV file new-file.csv without extension:

dotnet run new-file

Note that dotnet run new-file.csv works just fine.

Expected

The file is transformed like normal.

Actual

Type 'yes' if you wish to transform all 1 files listed above: yes
Reading rows from C:\Dev\osuuspankki-import\new-file...


Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'C:\Dev\osuuspankki-import\new-file'.
   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
   at System.IO.StreamReader..ctor(String path, Encoding encoding)
   at osuuspankki_import.Program.TransformCsv(String fileName, String transformedFileName) in C:\Dev\osuuspankki-import\Program.cs:line 78
   at osuuspankki_import.Program.Main(String[] args) in C:\Dev\osuuspankki-import\Program.cs:line 42

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions