3 ms·
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
by WalterBright 7y ago
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.
- duckqlz 7y agocouldn't you just link to a c file in the same dir then use that to read up the file tree. I would be interested to know how D would prevent this.
- WalterBright 7y agoD files don't #include .c files.
- floatboth 7y agoUnfortunately, 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.
- WalterBright 7y agoThat's fine with me. I don't want to make the cross site scripting mistake.
- pjmlp 7y agoWhich happen to be currently broken on modern .NET runtimes because it wasn't done on a clean way apparently.