ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* io.loaddata() or buffer.assigns()
       [not found] <mailman.514.1631031099.1197.ntg-context@ntg.nl>
@ 2021-09-08 20:47 ` Thierry Horsin via ntg-context
  0 siblings, 0 replies; only message in thread
From: Thierry Horsin via ntg-context @ 2021-09-08 20:47 UTC (permalink / raw)
  To: ntg-context; +Cc: Thierry Horsin

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-08 20:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.514.1631031099.1197.ntg-context@ntg.nl>
2021-09-08 20:47 ` io.loaddata() or buffer.assigns() Thierry Horsin via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).