Thread overview
Why can't the DMD compiler accept files or directories with white spaces even delimited by quotes?
Sep 04, 2021
Marcone
Sep 05, 2021
jfondren
Sep 05, 2021
Marcone
September 04, 2021

Example:

dmd "hello world.d"

September 05, 2021

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
September 05, 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.