[OSM-dev] tiles at home disk usage
Matthew Newton
matthew-osm at newtoncomputing.co.uk
Tue May 1 20:05:37 BST 2007
On Wed, May 02, 2007 at 04:32:54PM +0100, Grant Slater wrote:
> Overwriting a tile which is currently hard linked will change the file
> contents of ALL hard linked files.
>
> Removing the tile-file prior to be overwritten, would result in a new
> file and the other hard linked files not being affected.
>
> sudo code
> --------------------------
> if file_exists(x/y/tile.png) {
> rm (x/y/tile.png)
> create_file(x/y/tile.png)
> }
> --------------------------
Better, so that the update is atomic:
create_file(x/y/tile.png.new)
mv(x/y/tile.png.new, x/y/tile.png)
and then forget the stat.
--
Matthew
More information about the dev
mailing list