From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id C02AA24BAA for ; Fri, 23 Feb 2024 16:15:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 741FB484255 for ; Fri, 23 Feb 2024 16:12:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vorgAl4jJml6 for ; Fri, 23 Feb 2024 16:12:33 +0100 (CET) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 38698484318 for ; Fri, 23 Feb 2024 16:11:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E305D48298D for ; Fri, 23 Feb 2024 16:10:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q2fMLAb2eq_e for ; Fri, 23 Feb 2024 16:10:38 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=85.18.95.64; helo=mcpmr011msr.fastwebnet.it; envelope-from=massifr@fastwebnet.it; receiver= X-Greylist: delayed 558 seconds by postgrey-1.36 at cgl.ntg.nl; Fri, 23 Feb 2024 16:10:38 CET Received: from mcpmr011msr.fastwebnet.it (mcpmr011msr.fastwebnet.it [85.18.95.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 8994E482468 for ; Fri, 23 Feb 2024 16:10:38 +0100 (CET) X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledrfeeigdejudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhtefuvfghgfeupdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomhepmhhfuceomhgrshhsihhfrhesfhgrshhtfigvsghnvghtrdhitheqnecuggftrfgrthhtvghrnhepieeltdfhkeeifedtvddvheejteeufeejjeeikeevheeiheetleelueeiieejkeeinecukfhppeelhedrvddvledruddtkedrhedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurdehvdgnpdhinhgvthepleehrddvvdelrddutdekrdehtddpmhgrihhlfhhrohhmpehmrghsshhifhhrsehfrghsthifvggsnhgvthdrihhtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepnhhtghdqtghonhhtvgigthesnhhtghdrnhhl X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.52] (95.229.108.50) by mcpmr011msr.fastwebnet.it (5.8.715.01) (authenticated as massifr@fastwebnet.it) id 63720D5C1F9EBCB8 for ntg-context@ntg.nl; Fri, 23 Feb 2024 16:01:19 +0100 Message-ID: <811502b7-32d4-4131-843e-c9e653aa3c8a@fastwebnet.it> Date: Fri, 23 Feb 2024 16:01:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ntg-context@ntg.nl References: <269aab33-7bea-dc17-04f5-0b89342a425d@gmx.es> Content-Language: it-IT, en-US From: mf In-Reply-To: <269aab33-7bea-dc17-04f5-0b89342a425d@gmx.es> Message-ID-Hash: QN35U7LMFZVQF664DKHIUVZUBJ5OQBJS X-Message-ID-Hash: QN35U7LMFZVQF664DKHIUVZUBJ5OQBJS X-MailFrom: massifr@fastwebnet.it X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: output filename with SHA256 List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit Il 23/02/24 14:32, Pablo Rodriguez via ntg-context ha scritto: > Dear list, > > I have the following sample file: > > \starttext > whatever > > \startluacode > luatex.wrapup( > function() > local t = {} > local pdf_file_name = tex.jobname..".pdf" > local sha_pdf = utilities.sha2.hash256(io.loaddata(pdf_file_name)) > local c_r = environment.currentrun > t[c_r] = sha_pdf > local exists_pdf = ("%s_%s-%s.pdf"):format(c_r-1, tex.jobname, t[c_r-1]) > if io.exists(exists_pdf) then os.remove(exists_pdf) end > os.rename(pdf_file_name, ("%s_%s-%s.pdf"):format(c_r, tex.jobname, > sha_pdf)) > end > ) > \stopluacode > \stoptext > > In short, it adds its SHA256 to the final filename. > > Since renames the PDF document in each run, I would like to remove the > output from the previous run. > > The table seems not to store the value from a previous run. > > I see now that I am creating it again with each run. > > Is there any way to check if compilation needs any other run? > > Many thanks for your help, > > Pablo > ___________________________________________________________________________________ Hello Pablo, you can keep the log, tuc and pdf file of every run with the --keeplog, --keeptuc and --keeppdf options (type "context --help --expert" to know about the file naming). A new run is started unless: - the maxruns number of runs has been reached - the tuc file is identical to the one of the previous run Massi ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________