[Top][All Lists]

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

[Octave-bug-tracker] [bug #41836] plot command: temporaray file names no

From: anonymous
Subject: [Octave-bug-tracker] [bug #41836] plot command: temporaray file names not unique
Date: Tue, 11 Mar 2014 17:16:13 +0000
User-agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)


                 Summary: plot command: temporaray file names not unique
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Di 11 Mär 2014 17:16:11 UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
             Assigned to: None
         Originator Name: Martin Hepperle
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.4
        Operating System: Microsoft Windows



Currently I am running several shell scripts at the same time in parallel on a
multi-core system. These also call octave to create some plots.
When it comes to plotting to a bitmap file the results get mixed up.

The reason is that the plot command creates temporary files whose names are
just numbered per session (1, 2, ...)
If two octave sessions are running at the same time, chances are that they
want to use the same file which fails or that a later run overwrites the
temporary plot file.

To repair this, the temporary file names would have to be unique. At least to
a high degree of probability, e.g. using the rand() function.
A better approach would be to create a file name, test for its existence and
if so, increment a counter, otherwise create the file to "reserve" it.

The current code uses tmpnam() which should be replaced (probably tmpnam ()
should be modified to create at least a pseudo unique file name.

The following example shows the temporary file name (oct-7.eps):

octave:1> x = linspace(0,3,50);
octave:2> y = sin(x);
octave:2> plot(x,y);
octave:3> print('test.png','-dpng','-debug');
Ghostscript command:
-dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dTextAlphaBits
=4 -dGraphicsAlphaBits=4 -r150x150 -dEPSCrop -sOutputFile=wbd.png
-dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dTextAlphaBits=4
-dGraphicsAlphaBits=4 -r150x150 -dEPSCrop -sOutputFile=wbd.png
C:\Users\ea55\AppData\Local\Temp\oct-7.eps & del


Reply to this item at:


  Nachricht gesendet von/durch Savannah

reply via email to

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