I'm running WSL2 with Ubuntu-20.04 on Windows 10.
The exe named chap1 is in my ~/pascal dir along with input file mod.txt.
When attempting to open mod.txt, it crashes with a file not found error on line 591 which is the Reset command (see Log of Run below).
Prior to the Reset command, the exe displays the current dir as ~/pascal.
What would cause the mod.txt file to not be found in that dir?
I do have rw access to mod.txt-rw-r--r-- 1 dawsond dawsond 29 Jul 22 2016 mod.txt
Relevant Source Code BEGIN
infilename:=parseString; (* parse filename parameter *)
Writeln ('Current Directory is : ',GetCurrentDir);
writeln(' Loading file : ',infilename);
Assign(infile,infilename);
RESET(infile);
readfile:=true; (* set flag telling nextchar function to read from a file *)
if cmdnm = load then
echo:=true;
END;
Log of Run~/pascal$ ./chap1
-> )load mod.txt
Current Directory is : /home/dawsond/pascal
Loading file : mod.txt
An unhandled exception occurred at $0000000000402994:
EInOutError: File not found
$0000000000402994 line 591 of chap1.pas
$00000000004026D5 line 616 of chap1.pas
$00000000004025A3 line 633 of chap1.pas
$0000000000404EA5 line 1548 of chap1.pas
Version InfoLazarus IDE is not installed.
Ubuntu-20.04
WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2913
Free Pascal Compiler version 3.0.4+dfsg-23 [2019/11/25] for x86_64
Attempted Solutions- prefixed filename with full path
- added ~/pascal to $PATH