octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49779] print /non/existing/dir/file.svg crash


From: Avinoam Kalma
Subject: [Octave-bug-tracker] [bug #49779] print /non/existing/dir/file.svg crashes octave
Date: Fri, 27 Jan 2017 06:48:56 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

Follow-up Comment #7, bug #49779 (project octave):

What about the following check:


folder = fileparts (opts.name);
  if (~isempty(folder))
      if (~exist(folder,'dir'))
        str = sprintf ('print: directory %s does not exist', folder);
        error (str);
      end
  end
  
  fid = fopen (opts.name, 'w')
  if (fid == -1)
    str = sprintf ('print: cannot open file %s for writing',  opts.name);
    error (str);
  end
  fclose (fid);


It is close to Pantxo suggestion (comment#4), and solves this bug and
bug#50146. I know that this not the desired solutions, and does not solve
other expected and unexpected situations, it can
give an interim fix.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49779>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]