# Export[“test.txt”,111] doesn't export anything, generated a blank file

I am using Mathematica 11.2 windows version I found that

Export["test.txt",111]


generated a blank txt file. However, Export["test.dat",111] is right. But the doc says

Export["file.txt",expr] exports any expression to a text file.

Is it a bug?

PS. I just tried 11.2 linux version. Export["test.txt",111] has no such problem.

update

generally, "Text" option is corrupted on my Mathematica, for example

Export["test.dat", 111, "Text"]

also output blank file. But I have to use Export["test.dat", ..., "Text", DOSTextFormat -> False], Does anyone encountered the same problem? However to solve it?

update2

Several hours passed, I finally figure it out, and the result is quite peculiar, and seems like a bug.

Things goes like this.

Needs["CCompilerDriverGenericCCompiler"]


into your Mathematica's init file, then quit kernel, and run Export[file,content,"Text"], you will find the file is blank.

But If you just run Needs["CCompilerDriverGenericCCompiler"] in your notebook, it doesn't affect Export.

Quite odd! Wait someone to confirm.

update3

also Needs["CCodeGenerator"] has the same problem if you put it in your init file.

• Works fine in Win10 V11.2 – Kuba Oct 25 '17 at 12:52
• Hi, @Kuba. I am also on win10. I know this is ridiculous. But do you have any idea of figure out what is going on with my mathematica? – matheorem Oct 25 '17 at 13:07
• If Export is disabled, many of my function is not reliable. And I just took an hour to trace bug down to Export – matheorem Oct 25 '17 at 13:08
• @Kuba Export["test.txt",111,"Table"] is working. But Export["test.txt",111]` is blank – matheorem Oct 25 '17 at 13:11
• Can't experiment atm and don't know out of my head. :/ – Kuba Oct 25 '17 at 13:16