D deliberately restricts what compile time code can do that involves the operating system, restricting it to simply reading files from the current directory and down.
This is to prevent the use of the D compiler as a malware target by sending it specially crafted source code to compile.
Unfortunately, these restrictions make it hard to implement F# style Type Providers. Though honestly the filesystem one is not nearly as annoying as the inability to reinterpret-cast.
This is to prevent the use of the D compiler as a malware target by sending it specially crafted source code to compile.