[Gdal-dev] File extensions

Matt Hanson mhanson at photon.com
Wed Dec 6 22:33:00 EST 2006


Hi,
 
I'm using GDAL in an app where I want the user to specify an output format and have it be transparent to me in my app (after all, that's the point of GDAL).    The problem is that some drivers (including a custom one we have written) have specific file extension requirements.    When I call Create() I give it a filename.  Now, the driver should be smart enough to give it the correct extension if it doesn't have one.....but the problem is that I then have no way of knowing if the filename has been altered or not.
 
So, the problem is that I either:
- need to know what the driver is so I can give it the appropriate extension...but then that puts requirements on me to know the file format type which really is the responsibility of GDAL
- need to retrieve from GDAL the new name, in case it's been altered by the driver, after I create a dataset.  But I don't see any method to do this....did I miss something?
 
This seems like a very simple problem and perhaps I have overlooked something or am not being clever enough.  Anyone else run into this issue?
 
 
matt




More information about the Gdal-dev mailing list