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"

no errors.
I am not getting it. I do not know which space that is. I removed all the spaces and it still works for me. V 9.02, windows 7, 64 bit. but not important, as long as it works for you :)
aaa >>? Did you check to see if you have a file calledFileNameJoin[{Directory[],"input"}]? i.e. evaluateFileNameJoin[{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" – Nasser Nov 10 '13 at 05:38Putalways write, I think – matheorem Nov 10 '13 at 07:02"test" >> FileNameJoin[{Directory[], "input"}]no errors, and the file is created fine asC:\Users\me\Documents\inputand 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? – Nasser Nov 10 '13 at 07:11Get["input", Path -> Directory[]]and see what you get. I get the file name I created ok. – Nasser Nov 10 '13 at 07:15