Question: more information about I/O error?

I do not understand why I am getting permission denied trying to create a file.

restart;
fd := FileTools[Text][Open]("C:\\foo.txt", create=true,overwrite=true);

     Error, (in FileTools:-Text:-Open) permission denied

I am running the above on my PC, from Maple, using the same user which is me. I can ofcourse create a file on my C drive outside of Maple. So I do not understand why it says permission denied. Also tried "C:/foo.txt". Also tried

         fd := FileTools[Text][Open]("C:\\foo.txt", create,overwrite);

Any idea what can be the problem? and how to determine why it is giving this error? I am on windows 7, using Maple 2015.

http://www.maplesoft.com/support/help/maple/view.aspx?path=FileTools%2fText%2fOpen

http://www.maplesoft.com/support/help/maple/view.aspx?path=IO_errors

"permission denied" - An attempt was made to read from a file on which the user does not have
read permissions, or write to a file on which the user does not have write permissions."

Well, I do have write permission to make a file on my C drive !

I tried using fopen, and got same error

restart;
  try     
     fd := fopen("C:\\foo.txt",APPEND,TEXT);
  catch:
     print(`Unable to open file, error is`);
     print(StringTools:-FormatMessage(lastexception[2]));
  end try:

                 Unable to open file, error is
                      "permission denied"

So I have no idea why I keep getting permission denied.

Please Wait...