[mapserver-dev] Dynamicaly writing Mapfiles for WMS-Servers

Stephan Holl stephan.holl at intevation.de
Mon Feb 15 11:57:46 EST 2010


Hello Frank,

Frank Warmerdam <warmerdam at pobox.com>, [20100212 - 15:40:21]

> Stephan Holl wrote:
> > Hello mapserver users/devs,
> > 
> > we are developing an application which mainly displays charts and
> > graphic plotts about scientific data (hydrologic measurment-data).
> > Also vertical cross section through waterbodies can be produced. 
> > 
> > However, a WMS-component is needed and we are thinking about
> > Mapserver. Therefor one mapfile will be used and our mechanism is
> > able to add new layers to the mapfile depending on the workflow in
> > the app. Does anybody have any experience with such a setup?
> > 
> > There are some questions open, perhaps you can give us some hints
> > here:
> > * What happens when the mapfile gets written and a WMS-request
> > tries to open/read the mapfile directly? It seems that there are no
> >   flock-calls inside the mapserver-code for locking the mapfile.
> 
> Stephan,
> 
> I think the traditional unix approach to replacing a file atomically
> is to write it to a temporary name in the same directory and then
> using the rename() function.  The rename(2) man page mentioned that
> replacement of the existing file is atomic.
> 
> This should be enough to ensure that any attempt to read the file by
> mapserver would either get a consistent old or new version of the file
> without risk of it being in the middle of being written.  For this
> very reason unix keeps around old files that are open even if they
> have been unlinked.
> 
> So, I don't think we need to worry about flock() to enable this sort
> of (fairly common) scenario.

Thanks for your input. We will go your proposed way and see what we can
do with that. 
Probably we will move over to some sort of mapscript-dialect and
make the mapfile-tweaking with mapscript. (I have not deeply
investigated the map.save()-method for writing a mapfile yet, but hope
the rename()-function is used in there).

Best 

	Stephan

-- 
Stephan Holl <stephan.holl at intevation.de> | Tel.: +49 (0)541-33 508 3663
Intevation GmbH, Neuer Graben 17, 49074 OS  |  AG Osnabrück - HR B 18998
Geschäftsführer:  Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20100215/01fa834c/signature.bin


More information about the mapserver-dev mailing list