Filter löschen
Filter löschen

Print Error - Cannot open file: permission denied.

2 Ansichten (letzte 30 Tage)
Jennifer
Jennifer am 17 Okt. 2011
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 Kommentar
Daniel Shub
Daniel Shub am 17 Okt. 2011
Are you printing to a network or external storage drive? Do you have full permissions to the directory? What OS are you using?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jason Ross
Jason Ross am 19 Okt. 2011
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 Kommentare
Daniel Shub
Daniel Shub am 15 Nov. 2011
@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 am 15 Nov. 2011
@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).

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by