[R-sig-Geo] Closing readOGR handles

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri Mar 30 16:42:50 CEST 2012


On Fri, Mar 30, 2012 at 3:15 PM, Alexander Shenkin <ashenkin at ufl.edu> wrote:
> Hi folks,
>
> I'm opening some ESRI shapefiles with readOGR.  R seems to keep open
> file handles on the files opened.  Is there any way to close those
> handles without quitting R?  I don't see a read-only option on readOGR,
> nor do I see any close methods.  I've tried GDAL.close(x), but I get
> errors saying there's no "handle" slot.

 I don't see that happening. What OS are you on? How are you detecting
open file handles?

 On my Linux box if I use "lsof" before and after reading a shapefile
(with readOGR) I don't see any new file handles left open.

 If I open a file connection with "file" and "open" I do see a new
file handle, so if readOGR was leaving it open then I think I would
see it.

> packageDescription("rgdal")
Package: rgdal
Title: Bindings for the Geospatial Data Abstraction Library
Version: 0.7-5
Date: 2011-11-16

 would be useful...

Barry



More information about the R-sig-Geo mailing list