[Gdal-dev] RFC 12: Improved File Management

Frank Warmerdam warmerdam at pobox.com
Mon May 7 21:51:49 EDT 2007


Ray Gardener wrote:
> An issue here is that the returned filenames might not refer to files, 
> unless you know which VSI*L filesyshandler was used. Usually this 
> assumption is harmless -- the default handler is assigned at compile 
> time and set to use the machine's normal filesystem -- but when one 
> starts using other filesyshandlers (like you said, for mem and so 
> forth), then the assumption breaks.
> 
> If we want to enumerate and manage the physical entities in a dataset 
> regardless of how their storage is implemented, and add entity 
> management methods to GDALDataSet, the dataset needs to know how the 
> entities were stored. But storage details lie outside the driver. The 
> driver would need to forward an entity management call to the same 
> filesyshandler that originally wrote the entity.
> 
> So what we need is to have datasets know which filesyshandler they are 
> using. The driver's methods need an extra filesyshandler parameter, 
> which they can forward to datasets as part of the openinfo or something 
> similar. VSIFOpenL() needs to take a filesyshandler parameter, or 
> drivers should be able to call VSIFilesystemHandler::Open().

Ray,

The current virtual file system stuff is handled by installing a global
IO handler for a particular aspect of the filesystem namespace.  So,
for instance, the "in memory filesystem" stuff is all in the filesystem
area under /vsimem/.  Filesystem handlers are globally installed.  So
I don't see any need to make the file system handler apparent by
specifically passing it into Create() methods or to VSIOpenL().

> Then I could pass a filesyshandler subclass to driver::Create(), and 
> have the dataset do all of it's I/O with it, and know which 
> filesyshandler to use when doing entity management.
> 
> Issues like subdatasets could then be handled by treating the base 
> dataset as a filesystem, and implementing a filesyshandler for that 
> dataset's format.

I think there are two levels of indirection implicit in your statement.
One is at the VSI*L level which is raw binary data.  But subdatasets are
really a GDAL concept and their meaning vary from format to format.  I'm
not sure how to mesh this all.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list