[AOLSERVER] ns_tmpdir() issue

2 views
Skip to first unread message

Enrique Catalan

unread,
Feb 29, 2008, 12:37:31 PM2/29/08
to AOLS...@listserv.aol.com
Hi,

The function ns_tmpnam() defined in ..../$aolsrv_src/nsd/tclfile.c generates temp file names.  This function uses the tmpnam() C function and it works ok on Linux and all the files are stored in the tmp dir which is defined as P_tmpdir in the stdio.h file.

However, in the Win32 stdio.h file, P_tmpdir seems to be defined as "/" which is causing all the temp files generated by ns_tmpnam() ( http://msdn2.microsoft.com/en-us/library/x8x7sakw(VS.80).aspx ) to be stored in the root dir instead of the temp one.

Had you seen this before?
In terms of performance, scalability and stability, Do you think that would be safe if I just replace the "tmpnam(buf)" by "tempnam (getenv("TMP"), NULL) in the ns_tmpnam() function?  This way would let me make sure 100% that all the files are being stored in my temp dir.

Thanks,
Enrique

-- AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <list...@listserv.aol.com> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

Enrique Catalan

unread,
Mar 3, 2008, 6:21:16 AM3/3/08
to AOLS...@listserv.aol.com
Thanks John! I will try it and will let you now if have any issues in the 4.5 version.

-Enrique.

On 29/02/2008, John Caruso <jca...@arenasolutions.com> wrote:
On Friday 09:37 AM 2/29/2008, Enrique Catalan wrote:
In terms of performance, scalability and stability, Do you think that would be safe if I just replace the "tmpnam(buf)" by "tempnam (getenv("TMP"), NULL) in the ns_tmpnam() function?  This way would let me make sure 100% that all the files are being stored in my temp dir.

We've done this for years under AOLserver 3.4.2, though not 4.x.

- John
Reply all
Reply to author
Forward
0 new messages