ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Thierry Horsin via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Thierry Horsin <horsin@free.fr>
Subject: io.loaddata() or buffer.assigns()
Date: Wed, 8 Sep 2021 22:47:52 +0200	[thread overview]
Message-ID: <20210908204752.viduuvxodioanm6x@thierry-Latitude-5300> (raw)
In-Reply-To: <mailman.514.1631031099.1197.ntg-context@ntg.nl>

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	other threads:[~2021-09-08 20:47 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <mailman.514.1631031099.1197.ntg-context@ntg.nl>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210908204752.viduuvxodioanm6x@thierry-Latitude-5300 \
    --to=ntg-context@ntg.nl \
    --cc=horsin@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).