[Gvsig_english] Error when I open a DBF file

Antonio Falciano afalciano at yahoo.it
Tue Apr 3 17:12:30 CEST 2007


Here are the results of another test:

 >>> from java.io import FileInputStream
 >>> pathToDbf="D:\workspace\myDBF.dbf"
 >>> fileChannel=FileInputStream(pathToDbf).getChannel()
 >>> 
dbaseFileReaderNIO=gvSIG.classForName("com.iver.cit.gvsig.fmap.drivers.shp.DbaseFileReaderNIO")
 >>> dbaseFileReader=dbaseFileReaderNIO(fileChannel)
 >>> fields=dbaseFileReader.getHeader().getNumFields()
 >>> records=dbaseFileReader.getHeader().getNumRecords()
 >>> print fields
0
 >>> print records
0

This is not possible!

Regards,
Antonio

Antonio Falciano ha scritto:
> Hi list!
> I'm trying to read a DBF file without success...
> In Jython shell I have the following type of error:
>
> >>> from java.io import File
> >>> pathToDbf="D:\workspace\myDBF.dbf"
> >>> 
> dbaseFile=gvSIG.classForName("com.iver.cit.gvsig.fmap.drivers.dbf.DbaseFile") 
>
> >>> myDBFFile=File(pathToDbf)
> >>> dbaseFile.open(myDBFFile)
> TypeError: open(): expected 2 args; got 1
>
> From javadocs, the method "open" of "DbaseFile" accepts only one 
> argument.
> Why am I obtaining this error?
> The same happens with the class DbaseFileNIO:
>
> >>> 
> dbaseFileNIO=gvSIG.classForName("com.iver.cit.gvsig.fmap.drivers.shp.DbaseFileNIO") 
>
> >>> dbaseFile=dbaseFileNIO.open(myDBFFile)
> TypeError: open(): expected 2 args; got 1
>
> Do I perhaps forget something?
>
> Regards,
> Antonio
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at runas.cap.gva.es
> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>
>


More information about the Gvsig_internacional mailing list