Hi everybody
Are there any type of files that is required by io.loaddata or/and 
buffers.assign ?

The following code works pretty well if there is no compilation problem by g++.
But it fails, i.e. \typebuffer[Mybuffer], does not produce anything if g++ 
fails (due to some errors in the cpp)
I have checked that err.cpp is well and truly created when g++ fails. 
\startluacode
        io.savedata("complx.h",buffers.getcontent("MyBuffer1"))
        io.savedata("complx.cpp",buffers.getcontent("MyBuffer2"))
        io.savedata("testcomplx.cpp",buffers.getcontent("MyBuffer3"))
        local l=os.execute("g++ -O3 -Wall -o testcomplx testcomplx.cpp 
complx.cpp 2> err.cpp")
        if l==0 then
                os.execute("./testcomplx > testcomplx.tmp")
                buffers.assign("MyBuffer",io.loaddata("testcomplx.tmp"))
        else
                buffers.assign("Mybuffer",io.open("err.cpp","r"))
        
        end
\stopluacode

Many thanks
Thierry
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to