Why can't the DMD compiler accept files or directories with white spaces even delimited by quotes?

Marcone marcone at email.com
Sun Sep 5 00:04:03 UTC 2021


On Sunday, 5 September 2021 at 00:00:33 UTC, jfondren wrote:
> On Saturday, 4 September 2021 at 23:50:33 UTC, Marcone wrote:
>> Example:
>>
>> dmd "hello world.d"
>
> ```
> $ cat hello\ world.d
> module helloworld;
> void main() {
>     import std.stdio : writeln;
>     writeln("without the explicit 'module', this file would");
>     writeln("be inferred to have an invalid module name.");
> }
> $ dmd 'hello world.d'
> $ ./hello\ world
> without the explicit 'module', this file would
> be inferred to have an invalid module name.
> $ sed -i 1d hello\ world.d
> $ dmd 'hello world.d'
> hello world.d: Error: module `hello world` has non-identifier 
> characters in filename, use module declaration instead
> ```

Very Good! Now work fine.


More information about the Digitalmars-d-learn mailing list