[Kst] [Bug 116981] New: [patch] getdata: allow inclusion of other files in a dirfile format file

D.V.Wiebe dwiebe at physics.utoronto.ca
Thu Nov 24 01:09:17 CET 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=116981         
           Summary: [patch] getdata: allow inclusion of other files in a
                    dirfile format file
           Product: kst
           Version: unspecified
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
        AssignedTo: kst kde org
        ReportedBy: dwiebe physics utoronto ca


Version:           1.2.0dr1 (using KDE KDE 3.4.2)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.3.6 
OS:                Linux

The supplied patch (generated against 1.2.0dr1) gives getdata the ability to "include" additional format files in the primary format file of a dirfile.  The syntax is:

INCLUDE <file>

Included files are parsed as if their contents were pasted verbatim into the format file at the location of the INCLUDE.  Inclusion is recursive and while parsing a particular dirfile, getdata will remember which files it has already read, so it won't crash and burn on encountering a circular inclusion.

If an included format file cannot be opened (because, say, it doesn't exist), format file parsing will fail, and getdata will return (the new) error code GD_E_OPEN_INCLUDE.

Matt orgininally came up with the idea and, after both Enzo and Barth expressed enthusiasm for it, I went ahead and implemented it.  With BLAST analysis, we're drowing in dirfile fields and format file entries.  This allows us to better maintain our working dirfiles when dealing with dirfile fragments generated by various people working on the analysis, since it removes the necessity to maintain a single, monolithic format file.

The patch also seals a small file descriptor leak by closing format files after reading them, rather than keeping them open forever.

(This implementation is less cool that my original idea, which was to have getdata pipe the format file through "gcc -E" before parsing it... ;-)


More information about the Kst mailing list