[Qgis-user] Failing to open a valid shp file

William Kyngesburye woklist at kyngchaos.com
Thu Apr 12 20:23:45 PDT 2012


From what I understand from looking into this, ulimit isn't used by applications.  Apps use what's set for launchd (options set by launchctl). Kinda makes sense, applications have an environment, but it's not the same as used by shells (ie apps don't have a default PATH to find executables).

Also, the limits (ulimit or launchd) are per process, and I think also per thread.  QGIS may have more than the limit, but it has many threads.  But only one thread opens layer source files.  (note: some guesswork here)

On Apr 12, 2012, at 8:35 PM, Jeremy Dunck wrote:

> Hmm, interesting.
> 
> $ sudo lsof | grep -i 'qgis' | wc -l
>     363
> 
> $ ulimit
> unlimited
> 
> Even so, I tried it:
> 
> launchctl limit maxfiles 1024
> $ ulimit
> unlimited
> 
> Launched qgis, and it did indeed let me add more shapes without complaint.
> 
> So now I'm wondering what is enforcing this limit..
> 
> On Thu, Apr 12, 2012 at 5:59 PM, William Kyngesburye
> <woklist at kyngchaos.com> wrote:
>> There is a hard limit on OS X to how many files a single process (ie QGIS app) can have open at a time.  I believe it's 256, which when you count the 3 basic files of a shapefile set, means you can have 85 shapefiles in a project.
>> 
>> When QGIS tries to open that 86th shapefile it can only open 2 of the 3 files, and without the 3rd file it becomes unrecognizable, thus the misleading error.
>> 
>> Last time I looked into this, it unfortunately couldn't be globally changed for all applications.  It's possible to override the limit for individual processes, but the method only works from a Terminal, which is not the normal way to start applications.
>> 
>> It may be possible now with launchctl.  Try running this command in a Terminal, then run QGIS normally and open your project with >85 shapefiles:
>> 
>> launchctl limit maxfiles 1024
>> 
>> On Apr 12, 2012, at 6:48 PM, Jeremy Dunck wrote:
>> 
>>> I'm using the shapefile found here:
>>> 
>>> http://www.flsenate.gov/Session/Redistricting/Plan/s016s9030
>>> specifically:
>>> http://www.flsenate.gov/PublishedContent/Session/Redistricting/Plans/S016S9030/S016S9030_shp.zip
>>> 
>>> If I open just this one file, it works.  If I open it in a project w/
>>> a bunch of other shapes, it fails - most of the time.  I repeatedly
>>> tried opening the same file (without changing anything on the
>>> filesystem) and finally, it worked.  The only difference I can see is
>>> that I removed a different shp from the project before adding this one
>>> succeeded.
>>> 
>>> The error I'm getting is:
>>> "/path/to/20120401/s000s9008.shp is not a valid or recognized data source"
>>> 
>>> I've attached a screenshot of my About page; this is on Mac 10.7.3.
>>> 
>>> I tried to see if there was a logfile but no dice:
>>> $ sudo lsof | grep -i qgis
>>> 
>>> How can I troubleshoot this?
>>> <Screen Shot 2012-04-12 at 4.37.47 PM.png>_______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>> 
>> -----
>> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
>> http://www.kyngchaos.com/
>> 
>> "History is an illusion caused by the passage of time, and time is an illusion caused by the passage of history."
>> 
>> - Hitchhiker's Guide to the Galaxy
>> 
>> 
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

The equator is so long, it could encircle the earth completely once.




More information about the Qgis-user mailing list