Opened 7 years ago

Closed 6 years ago

#5558 closed enhancement (fixed)

Convert mitab from FILE* to VSILFILE*

Reported by: mpd Owned by: warmerdam
Priority: low Milestone:
Component: default Version: unspecified
Severity: minor Keywords: mitab
Cc:

Description

The attached patch converts the main parts of mitab (except for things like the - debugging - Dump methods) to use VSILFILE* instead of FILE*.

The patch is required on Windows which has a hard limit of FILE* handles per process, for users who wish to open large numbers of TAB files at the same time.

The patch is against r27490, on the trunk.

See also ticket:5556, which discusses a related change to the Win32 VSI*L implementation, for performance reasons.

Attachments (1)

mitab-vsilfile.patch (30.5 KB) - added by mpd 7 years ago.
mitab patch from FILE* to VSILFILE*

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by mpd

Attachment: mitab-vsilfile.patch added

mitab patch from FILE* to VSILFILE*

comment:1 Changed 7 years ago by Even Rouault

Milestone: 2.0

I've corrected a few errors :

  • .mif/.mid writing was broken (erroneous use of VSIFPrintfL with a va_list argument)
  • .mif/.mid reading was broken as well (subtle difference of behaviour w.r.t end-of-file flag between CPLReadLine and CPLReadLineL())
  • compilation error somewhere due to a missing replacement of FILE* with VSILFILE* ( compilation with -DDEBUG turn on stricter type enforcing)

I've also added the GDAL_DCAP_VIRTUALIO flag in the driver capabilities.

trunk r27494 "MITAB: convert to use of VSI*L FILE API (based on patch by mpd, #5558)"

comment:2 Changed 7 years ago by Even Rouault

Submitted to mitab upstream as https://github.com/mapgears/mitab/pull/12

comment:3 in reply to:  1 ; Changed 7 years ago by mpd

Replying to rouault:

I've corrected a few errors :

Thanks for that. We don't use mitab for MIF/MID (for historical reasons) so missed these.

comment:4 in reply to:  3 ; Changed 7 years ago by Even Rouault

Replying to mpd:

Replying to rouault:

I've corrected a few errors :

Thanks for that. We don't use mitab for MIF/MID (for historical reasons) so missed these.

But running the autotest suite would have caught it ;-)

comment:5 in reply to:  4 Changed 7 years ago by mpd

Replying to rouault:

But running the autotest suite would have caught it ;-)

Ha! Fair point: I'll have my butler do it next time ;)

comment:6 Changed 6 years ago by Even Rouault

Milestone: 2.0

Removing obsolete milestone

comment:7 Changed 6 years ago by Even Rouault

Resolution: fixed
Status: newclosed

Batch closing of MITAB tickets fixed in GDAL. They were kept open because not merged into MITAB separate repository, but the latter one is inactive, so let's close them definitely.

Note: See TracTickets for help on using tickets.