March 01, 2017 rdmd with a file with no extension | ||||
|---|---|---|---|---|
| ||||
When running a small D program through rdmd, it seems the file needs a .d extension to work.
```
$ ./testscript2
Error: module testscript2 is in file './testscript2.d' which cannot be read
$ cat testscript2
#!/usr/bin/env rdmd
void main(string[] args){
import std.stdio;
writeln(args);
}
```
Trying the above on OSX if that makes a difference.
Any way to get these to work short of renaming it testscript2.d?
| ||||
March 01, 2017 Re: rdmd with a file with no extension | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Colin | On Wednesday, 1 March 2017 at 16:06:20 UTC, Colin wrote: > When running a small D program through rdmd, it seems the file needs a .d extension to work. It looks like the file extension is enforced: https://dlang.org/dmd-windows.html#switches Looks like a feature rather than a bug... At the command line, both "file" or "file.d" make the compiler look for "file.d". Even "file.c" is understood as "file.c.d" | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply