Hi Hazen and Andrew,

>> Thanks for the links. I've now implemented a function  
>> pl_create_tmpfile which
>> should meet our needs. It will create a secure temporary file in a  
>> standard
>> way across platforms.
>>
>> The function always returns a file handle (or -1 on failure).
>>
>> If a char ** is passed then the filename will also be returned in  
>> the pointer.
>> If the file name is not returned then the file will automatically  
>> be deleted.
>> It the file name is returned then the user is responsible for  
>> deleting the
>> file and also for freeing the memory associated with the file name.  
>> I hope to
>> avoid using the latter since there is a race condition associated  
>> with it, but
>> currently I may need it because of the way the plplot code is  
>> written.
>>
>> The temporary file will be created in the directory given by TMPDIR  
>> (UNIX) or
>> TEMP (windows) if they are set. Otherwise it will try P_tmpdir (if  
>> defined).
>> Finally it will try the default /tmp (UNIX) or c:\windows\temp  
>> (windows)
>> directory.
>>
>> Note that non-linux support is not tested at all. Before proceeding  
>> further I'd
>> like to check this at least compiles on a range of windows / mac  
>> platforms.

I now made the corresponding changes, so that plstdio.c compiles and  
links for Visual C++ (2008). I have not tested the function though if  
it works.
>
>
> Could you verify that I have the right type (int) for the variable
> flags? Also, on Windows with mingw32 I'm getting the following warning
> message:
>
> [  9%] Building C object src/CMakeFiles/plplotd.dir/plstdio.c.obj
> C:\users\hazen\plplot\src\plstdio.c:206:1: warning: "_S_IREAD"  
> redefined
> In file included from C:\users\hazen\plplot\src\plstdio.c:31:
> C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h: 
> 39:1:
> warning: this is the location of the previous definition
> C:\users\hazen\plplot\src\plstdio.c:207:1: warning: "_S_IWRITE"  
> redefined
> C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h: 
> 38:1:
> warning: this is the location of the previous definition
> [ 10%] Building C object src/CMakeFiles/plplotd.dir/plstripc.c.obj

I changed the code, so that _S_IREAD and _S_IWRITE are only defined if  
undefined. This removes the warnings (also for MinGW I assume), but I  
consider this code "suboptimal".

Regards,
Werner
>
> -Hazen
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
> 30-Day
> trial. Simplify your report design, integration and deployment - and  
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Plplot-devel mailing list
> Plplot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plplot-devel


--
Dr. Werner Smekal
Institut fuer Angewandte Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria
DVR-Nr: 0005886

email: sme...@iap.tuwien.ac.at
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
        +43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to