Error, permission denied
Error, (in ...) permission denied
Error, could not open `...` for writing
Description
Examples
This error message occurs when a command tries to write to a file that you do not have write permissions to (or if there's a file already there that you do not have permission to overwrite).
To solve this problem, do one of the following:
Change the current working directory. See currentdir.
Specify a full filepath. See file.
Specify the base directory in which the file will be written. This option is understood by the Import, Export, and FileTools:-JoinPath commands.
Further note for Windows users: In some cases, due to Windows security settings, you may need to open Maple with administrator privileges in order to write to certain file locations. In that case, right-click on your desktop Maple icon, and select Run as administrator.
Example 1
L⁢:=⁢[−81−98−76−429−38−77−722744−1857−28928727−3269−3133−93−749967]:
ExportMatrixmatrixdata.txt,L:
Error, (in ExportMatrix) permission denied
This error message indicates you do not have write permissions for the current working directory.
Solution:
Before exporting the matrix, change the current working directory, either using the currentdir command, or interactively by clicking on the current directory listed in the status bar at the bottom of your Maple window, and browsing to a new directory.
Example 2
Exportsinefile.jpg,plot⁡sin:
Before you begin working in Maple, ensure that you have write permissions for the directory or file that you want to write to. You might want to use a temporary directory, or as in this case, specify the base directory in which the file will be written.
Exportsinefile.jpg,plot⁡sin,base=homedir:
Example 3
a,b,c≔1,1,2:
save a, b, c, temp.m:
Error, could not open `temp.m` for writing
This error message from the save statement similarly indicates you do not have write permissions for the current working directory. Either change the current working directory, or provide a full filepath, e.g.,
save a, b, c, C:\\Users\\username\\Documents\\temp.m:
See Also
FileTools[IsWritable]
FileTools[TemporaryDirectory]
I/O Errors
Download Help Document