Closed bennydiamond closed 3 years ago
That's weird. The code doesn't seem to be duplicating the path anywhere.
I was able to replicate it in WSL2, installed latest mono-devel.
If I run it with mono, the error above appears.
If I run it standalone, a different error appears:
Unhandled Exception: System.NotSupportedException: The given path's format is not supported.
at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShar
e share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea
n useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileO
ptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 buffe
rSize, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding)
at System.IO.File.InternalReadAllLines(String path, Encoding encoding)
at PSXPackager.GameDB..ctor(String path)
at PSXPackager.Processing..ctor(INotifier notifier, IEventHandler eventHandler)
at PSXPackager.Program.ProcessFiles(ProcessOptions options)
at PSXPackager.Program.<>c__DisplayClass2_0.<Main>b__0(Options o)
at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
at PSXPackager.Program.Main(String[] args)
After adding some debug code, the paths appear as follows:
WSL/Direct
file:\wsl$\Ubuntu-18.04\home\enderwiggin\PSXPackager\PSXPackager\bin\Debug\net462\Resources\gameinfo.db
Mono
home/enderwiggin/PSXPackager/PSXPackager/bin/Debug/net462/Resources/gameinfo.db
So the path seems to be duplicated because there is no root slash, so it's being treated as a relative path.
It turned out to be the path and the casing of "gameInfo.db". I've found the proper way to get the application path that works in Mono, Linux and Windows.
I've pushed an update, please get latest.
Env: Ubuntu Server 18.04 x64, latest dotnet runtime framework installed. Using release package 1.4 from Github release page. Executable package uncompressed and executed directly in same folder the PSX isos are in.
Looking at stack trace, it looks like AppPath value is duplicated, leading to wrong absolute path.
/media/4TB1/Torrents/complete/1G1R - Redump - Sony - PlayStation/toconvert/media/4TB1/Torrents/complete/1G1R - Redump - Sony - PlayStation/toconvert/Resources/gameinfo.db