Andrew Ross wrote:
> Alan,
> 
> 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.

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

-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

Reply via email to