I get the error message "permission denied" when I run this code. Is this error caused by the permissions on my mac or is it because of the code? I used the same example as MSDN.
static void Main(string[] args)
{
Process.Start("readme.txt");
};
Process.Start
accepts the name of an executable or a document. According to the docs:
The file name does not need to represent an executable file. It can be of any file type for which the extension has been associated with an application installed on the system. For example the file name can have a .txt extension if you have associated text files with an editor, such as Notepad, or it can have a .doc if you have associated.doc files with a word processing tool, such as Microsoft Word.
This description may be limited to the Windows platform. I would guess that the implementation on macOS is limited to running executable files.
If you want to use MacOS's default editor then you should be able to run it as follows:
Process.Start("open", "readme.txt")
Bear in mind that open
is a MacOS-specific utility, so this won't work on other operating systems.