Executing a D script without an [extension in the filename] leads to an error

BoQsc vaidas.boqsc at gmail.com
Fri Mar 1 09:00:43 UTC 2019


I've installed D compiler, and when i try to run a D script with 
filename without an extension/file type named: program

via: ./program

I'm getting and error:

vaidas at SATELLITE-L855:~/Desktop$ ./program
Error: module `program` is in file './program.d' which cannot be 
read
import path[0] = .
import path[1] = /snap/dmd/49/bin/../import/druntime
import path[2] = /snap/dmd/49/bin/../import/phobos
Failed: ["/snap/dmd/49/bin/dmd", "-v", "-o-", "./program.d", 
"-I."]


Now, when I rename my scirpt file : program
To: program.d

and execute it by: ./program.d

I no longer have an error.

Is this an intended behaviour?


More information about the Digitalmars-d-learn mailing list