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
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
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
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
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 Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!