This is similar to issue #103 where -D was not creating subdirectories. If -op is specified, DMD should create any intervening directories rather than failing. Example:
C:\code\src\d>dmd test\test.d -odc:\temp -op
Error: Error writing file 'c:\temp\test\test.obj'
C:\code\src\d>
The above error should not occur.
This is important when building projects containing multiple same-named modules (such as "exception", where simply using -od is insufficient) and the project folders are read-only for the building process.