[gdal-dev] ogr problems with MapInfo

Daniel Morissette dmorissette at mapgears.com
Mon Oct 4 10:23:13 EDT 2010


Chaitanya kumar CH wrote:
> Hi,
> 
> I think the problem is with the call to stat() on the samba mounted
> files. tab2tab reported the same problem.
> 


Yes, that's what I think as well. I sent a small test program to
Sebastian off-list last week to try to find out more information about
what is happening but haven't heard back from him yet.

Here is a copy of what I sent in case you're interested:


-------- Original Message --------
Subject: Re: [gdal-dev] ogr problems with MapInfo
Date: Thu, 30 Sep 2010 10:09:17 -0400
From: Daniel Morissette <dmorissette at mapgears.com>
To: Sebastian E. Ovide <sebastian.ovide at gmail.com>

(Taking this off-list, we'll summarize on the list later)

Sebastian E. Ovide wrote:
> done... didn't work...
>
> Copied on the same SMB folder with undercase names... both ogrinfo and
> tab2tab failed.
> Copied the same files to a local folder and both ogrinfo and tab2tab
> succeeded...
>
> same errors....
>

It may be that stat() is failing for some reason. Can you please test
with the following little program, save it as test_stat.cpp in the
mitab-1.x/mitab/ source directory:

---------- mitab-1.x/mitab/test_stat.cpp ---------
include "cpl_vsi.h"

int main(int argc, char *argv[])
{
    VSIStatBuf  sStatBuf;
    struct stat stat_buf;
    int status;

    if (argc != 2)
    {
        printf("Usage: %s <filename>\n", argv[0]);
        return -1;
    }

    status = VSIStat(argv[1], &sStatBuf);
    printf("VSIStat(%s) = %d (%s)\n", argv[1], status ,
status?strerror(errno):"" );

    status = stat(argv[1], &stat_buf);
    printf("stat(%s) = %d (%s)\n", argv[1], status,
status?strerror(errno):"" );

}
-----------------------------------------------

And then add the following target (lines) at the end of the GNUmakefile
in that directory:

---------- mitab-1.x/mitab/GNUmakefile ---------

test_stat: test_stat.o $(LIBS)
	$(CXX) $(LFLAGS) -o test_stat test_stat.o $(LIBS) -lm
-----------------------------------------------
(Note that the second line start with a real TAB character, not spaces)

... and build it using 'make test_stat'

... and finally try running it against one of your files. e.g.

  ./test_stat /home/gis/data/tmp/CA_AbandonedMine.MAP

and also against the version with lowercase extension:

  ./test_stat /home/gis/data/tmp/CA_AbandonedMine.map

... and let's see what output we get.

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/


More information about the gdal-dev mailing list