Print Error - Cannot open file: permission denied.

5 次查看(过去 30 天)
Hello all,
I'm getting an error sporadically when I'm running my program. I generate multiple plots and save them using a command like:
print('-dpsc2','-r144', [OutputString '_Sinkage_and_Pitch_VS_Ship_Speed'])
Sometime it runs fine, other times I can't get the first plots saved, and other times it stops after a few plots. I just simply run the program again and usually after 2~3 attempts, I don't get an error and it runs just fine. I'm wondering if anyone would have any insight as to why I'm getting this error.
Error:
??? Error using ==> print>LocalPrint at 286 .\RES_A_Total_Resistance_and_Effective_Power_VS_Ship_Speed.ps: Cannot open file: permission denied.
Error in ==> print at 228 LocalPrint(pj);
Thanks.
  1 个评论
Daniel Shub
Daniel Shub 2011-10-17
Are you printing to a network or external storage drive? Do you have full permissions to the directory? What OS are you using?

请先登录,再进行评论。

回答(1 个)

Jason Ross
Jason Ross 2011-10-19
I would look into Daniel's permission question, and also check the amount of:
  • Temp / swap space on your machine
  • Disk space on your machine
  • Disk space on the network resource (if you are saving to a network resource)
  4 个评论
Daniel Shub
Daniel Shub 2011-11-15
@Peter, You might be better off posting this as a new question. As for an answer, what are all the ~ doing in the path? I think on Windows the maximum path length + filename length is 255, how long is your path?
Peter
Peter 2011-11-15
@Image Analyst: the file name 'myfilename' does change on each iteration, but the only thing that changes is a few characters (i.e., the path, basic file name format and length, and file extension all remain the same). The post-script file is (AFAIK) a temp file created by the built-in MATLAB function 'print.m' or one of its subfunctions - something I don't have control over. I can't find any similarly-named file on my machine. Note that I'm using the 'recycle off' function at the start of my code, because before I did that similar temporary post-script files were being sent to my recycle bin rather than just being deleted after the .pdf file was created.
@Daniel: I'll try posting as an original question. Per the path issue, I was just trying to eliminate folder names so that just the filename (and not the path) on my computer was visible - sorry if it's not correct computer-ese. Both of those file paths are fine in terms of length; the one is simply where MATLAB installed the built-in 'print.m' file and the other is just a temp folder created by Windows XP (both something I don't have control over).

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by