[mapserver-dev] RFC 66 - Better handling of temporary files

thomas bonfort thomas.bonfort at gmail.com
Fri Jan 14 07:46:01 EST 2011


Jeff,
I don't like TEMPPATH because it should not be necessary for a user to
have to configure it. On unix, there is a system function that will
guarantee to create you a temp file without having to make the
assumption it will be in /tmp, and I imagine it could be possible to
implement something similar for windows if it doesn't exist.
Let's not burden our users with setting a configuration variable for
something that is system related and should be taken care of
transparently.

regards,
thomas

On Fri, Jan 14, 2011 at 13:37, Jeff McKenna
<jmckenna at gatewaygeomatics.com> wrote:
> My feedback:
>
> - small world: last week I started a (popular) thread on the libtiff mailing
> list about the problems of switching to mkstemp() for my Windows compiles
> (http://old.nabble.com/Missing-mkstemp%28%29-on-Visual-Studio-2008-td30635217.html)
>
> - in the case that TEMPPATH is not set in mapfile or env variable, I would
> like to see MapServer log a message such as "TEMPPATH not set, using C:/Temp
> for temporary files."  I think that requirement should be added to the RFC
> (log message).  For example, if I was doing testing with shp2img I would
> like to see that message returned when I was using a DEBUG level of 3 or
> higher.
>
> -jeff
>
>
> --
> Jeff McKenna
> MapServer Consulting and Training Services
> http://www.gatewaygeomatics.com/
>
>
> On 11-01-14 7:55 AM, Daniel Morissette wrote:
>>
>> On 11-01-14 03:25 AM, thomas bonfort wrote:
>>>
>>> are there valid reasons for not using mktemp (or even better mkstemp,
>>> but that returns a file handle, maybe the mapserver functions require
>>> a file name) ?
>>>
>>
>> I remember that's been discussed a while ago and had forgotten the
>> reasons. I did a search and found only one ticket that talks about the
>> possibility of using mkstemp():
>>
>> http://trac.osgeo.org/mapserver/ticket/1322
>>
>> It seems that a switch to mkstemp() was ruled out at that time because
>> of release timing and then the original issue was successfully fixed we
>> never came back to that question.
>>
>> Perhaps we could review the code that uses msTmpFile() and see if a
>> switch to mkstemp() (and GetTempFileName() on Windows) would be
>> possible. We may find that some places require a filename that is later
>> passed to other libs, or that the temp filename needs to carry a
>> specific extension... but maybe not.
>>
>> Can you please investigate that Alan?
>>
>
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>


More information about the mapserver-dev mailing list