Error during GM_LoadLayerList() is leaving file handle open
jfergus
Global Mapper User
Hi, I'm using C# in a Windows Forms app built in VS 2010. I have a scenario where I'm invoking a call to GM_LoadLayerList() on a file that I know is badly formatted, and as expected the DLL is returning a GM_Error_LoadError. My application then attempts to delete the file and it's getting an error because the DLL apparently opens the file, dislikes the format, returns an error code but doesn't close the file.
Is there an option I can set or a means by which I can get the file to close?
Thanks!
Is there an option I can set or a means by which I can get the file to close?
Thanks!
Comments
-
What format is the file? Most of the loaders should close it properly, but it's certainly possible there is one that doesn't close properly when it fails to load.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/products/global-mapper.php -
The file is a TIF. At startup the application copies a number of files off a network drive to a local folder in which each file is processed. I believe there was a network "glitch" during the copy which corrupted this file, because it's perfectly okay at the network source. I suspect the "half baked"/corrupted version is probably generating an internal exception or causing the instruction path to head down an unexpected path.
In any event, it's not a huge problem, as I can manually delete the file when the application terminates. Ideally, though, the application can perform the necessary cleanup, because then I could attempt to re-retrieve a file that fails to see if the retry can correct it. This application is a long-running batch-like app which often runs overnight or over the weekend, so error-detection/correction logic would be beneficial in this scenario.
Thanks for any suggestions/information you can provide! -
Which version of the SDK do you have? I was able to find the problem and make the file handle close when the TIFF format can't be verified. I can make a new build of the v14 SDK with that change if you are on that.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/products/global-mapper.php -
GM_GetSDKVersion() returns 135.
-
That is an older one. You can contact gmorders@bluemarblegeo.com and they can work with you to upgrade your SDK. The change to release the TIFF file handle will be in the SDK v14.1 release next week.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/ -
Awesome, thank you, Mike!
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website