LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   [C#] monodevelop acces to the path is denied?? (https://www.linuxquestions.org/questions/programming-9/%5Bc-%5D-monodevelop-acces-to-the-path-is-denied-883396/)

michaelinux 05-29-2011 05:01 PM

[C#] monodevelop acces to the path is denied??
 
i'm trying to run some code i had written a couple of weeks ago in windows :$, the program has to create and copy some files and when i try to run this code in monodevelop i get this error:
Unhandled Exception: System.UnauthorizedAccessException: Access to the path '/tmp' is denied.

i've tried to change the path where i know i have read/write permissions but it doesn't seem to work, the code was originally written to create a file in the Temp folder in windows.

estabroo 05-31-2011 05:14 PM

can you post the pertinent section of code?

You can do something like this that'll work in both windows and linux for application specific data (might even be per user, iirc)

string filename = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),"filenam e");
...


All times are GMT -5. The time now is 10:42 AM.