From: "Procházka Lukáš Ing." <LPr@pontex.cz>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: wrapup
Date: Fri, 21 Sep 2018 15:58:56 +0200 [thread overview]
Message-ID: <op.zpo2gi0l3h68c7@lpr> (raw)
In-Reply-To: <5504df99-0e2c-adca-ec2b-6d5b8ba396f5@xs4all.nl>
Hello,
just a note:
whilst command line option "--result=..." must point to the dir where the processed file is located, "os.rename()" allows to move files across dirs (at least on Win7), so this might be a way to evade "--result" limitation.
Best regards,
Lukas
On Fri, 21 Sep 2018 13:01:14 +0200, Hans Hagen <j.hagen@xs4all.nl> wrote:
> I'll add documentdata.variable so that one can do this:
>
> \setupdocument
> [id=foo]
>
> \startluacode
>
> luatex.wrapup(function()
> local id = documentdata.variable("id")
> if id and id ~= "" then
> local oldname = file.addsuffix(environment.jobname,"pdf")
> local newname = file.addsuffix("doc-"..id,"pdf")
> if lfs.isfile(newname) then
> -- print("removing",newname)
> os.remove(newname)
> end
> if not lfs.isfile(newname) then
> -- print("renaming",oldname,newname)
> os.rename(oldname,newname)
> end
> if not lfs.isfile(newname) then
> -- print("error in renaming")
> end
> end
> end)
>
> \stopluacode
>
> \starttext
>
> test
>
> \stoptext
>
--
Ing. Lukáš Procházka | mailto:LPr@pontex.cz
Pontex s. r. o. | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS: nrpt3sn | IČO: 40763439
Bezová 1658
147 14 Praha 4
Mob.: +420 702 033 396
___________________________________________________________________________________
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
___________________________________________________________________________________
prev parent reply other threads:[~2018-09-21 13:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-21 11:01 wrapup Hans Hagen
2018-09-21 13:58 ` Procházka Lukáš Ing. [this message]
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=op.zpo2gi0l3h68c7@lpr \
--to=lpr@pontex.cz \
--cc=ntg-context@ntg.nl \
/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).