I can not figure out why the code below doesn't work?
aaa >> FileNameJoin[{Directory[],"input"}]
error message came out saying
OpenWrite::noopen: Cannot open FileNameJoin[{Directory[],"input"}].
If I evaluate
FileNameJoin[{Directory[],"input"}]
directly, then I can get
C:\Users\m&p\AppData\Local\Temp\input
And the code below always works
aaa >> "C:\\Users\\m&p\\AppData\\Local\\Temp\\input"
aaa >>
? Did you check to see if you have a file called ` FileNameJoin[{Directory[],"input"}]` ? i.e. evaluate ` FileNameJoin[{Directory[],"input"}]` and see what it says, then go see if that file exist. btw, you code says "input" but the message you show says "input2" $\endgroup$Put
always write, I think $\endgroup$"test" >> FileNameJoin[{Directory[], "input"}]
no errors, and the file is created fine asC:\Users\me\Documents\input
and I opened the file with text editor and it has "test" in it. Windows 7, M V 9.01. It might be the space you have there in the folder path? what is that&
you show there in the name? $\endgroup$